Am currently cleaning up code in preparation for VB.Net Migration.
Am Adding Option Explicit to my VB6 code where missing and have come across a situation I need assistance in resolving.
Code:
If IsObject(SomeControl) then
Msgbox "Control Exists in this project"
else
Msgbox "Control does not exist in this project"
Endif
This code works properly to detect the existence of a control providing that I do not include Option Explicit in my code.
If I do use Option Explicit and SomeControl does not exist in project then I get Undefined Variable error on SomeControl.
How do I use IsObject to detect presence of object when OptionExplicit is ON?
Lee


Reply With Quote

