OS. User Type Not Defined
The message may be appearing because the OpenSTAAD library references have not been included. The VBA compiler therefore does not know which functions are associated with the OpenSTAAD object.
There are two ways to eliminate this error message:
Declare the OpenSTAAD object As Object, instead of As Output, e.g.
Dim objOpenSTAAD As Object
- Include the OpenSTAAD library reference in your VBA editor. This second option has the added benefit that once you do it, the compiler will now recognize the OpenSTAAD object and will pop up a list of functions whenever you refer to the object in your VBA editor.
To include the OpenSTAAD library reference, select Tools > References in your VBA editor. A dialog titled References – Normalopens. You will see a scroll box inside the dialog box labeled Available References. Scroll down through the list of references until you find and entry labeled OpenSTAAD 1.0 Type Library. Toggle on the corresponding check box, then click OK.
Now re-run your macro to see if the problem with the User Defined type not defined error message has been solved.