Objet exists
Hi Erel and Agraham,
to Agraham: Yes, it was my first approach, but as the object not always exists, is not always needed to 'New' it.
to Erel: Tried your code, but I can´t parse the objet to Objetexist function.
I'll try to explain myself better. It's a Serial objet, and I got the 'undeclared array' error using Erel's code.
The error I got is in the following sentence:
Sub Form_Close
If Serial1.PortOpen=true Then Serial1.PortOpen = false
End Sub
If Serial1 hasn't been created with the New method, I can't use it (obviously). What I was looking for is something like this:
Sub Form_Close
If ObjetExist(Serial1.) Then
If Serial1.PortOpen=true Then Serial1.PortOpen = false
End if
End Sub
or
If Serial1.Exists then...
but this method doesn´t exists, isn´t it?
Thank you.