OpenSTAAD V8i

5.6 User Type Not Defined

Error message:

"User Defined type not defined"

This message "User Defined type not defined" may appear on the line which declares the OpenSTAAD object variable if the variable is declared “As Output”, e.g., “Dim objOpenSTAAD As Output”.  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:

  1. Declare the OpenSTAAD object As Object, instead of As Output, e.g.

    Dim objOpenSTAAD As Object
  2. 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 box with title “References – Normal” will open.  You will see a scroll box inside the dialog box labeled “Available References.”  Scroll down through the list of references until you find one called “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.