excel VBA compile error: User-defined type not defined

J

joe mo

Need help, please!
In an excel vba automation, I refer to the visio, but there is no visio
install on another computer, and that automation won't work. Is there a way
to not refer the visio when there is no visio applicaiton installed, but
refer it when it is installed?
thanks,
 
J

Jeff Hopper

You could call CreateObject("Visio.Application") and use OnError to trap
error 429 (ActiveX component can't create object). If the error occurs, set
a flag, and conditionally call any Visio-related code based on that flag.
 
Top