STAAD.Pro Help

OS. Connect a VBA Editor to STAAD

To connect your Visual Basic for Applications Editor to STAAD in order to use autocomplete, do the following.

This procedure is optional, but highly recommended in order to have your editing environment be able to assist you in writing code.
Tip: The procedure below is show for Microsoft® Office Excel® , but is similar to how to perform this for most any VBA compatible application.
  1. Start Microsoft Office Excel as an administrator. Performing the following steps as an administrator allows your to make a change to the template. This prevents you from having to re-perform this task every time you edit your VBA macro.
    1. From either the Windows Start menu or Windows Explorer, right-click on the Excel application.
    2. Select Run as administrator from the pop-up menu.
    You are asked if you want to allow the application to make changes to your computer. Confirm you will allow this.
  2. In Excel, select the Visual Basic tool in the Code group on the Developer ribbon tab. The Microsoft Visual Basic for Applications window opens.
  3. Select Tools > References. The Reference - VBA Project dialog opens.
  4. Click Browse. The Add Reference dialog opens.
  5. Navigate to and select C:\Program Files\Bentley\Engineering\STAAD.Pro CONNECT Edition\ STAAD\StaadPro.dll and then click Open.
  6. Scroll through the list of Available References to locate OpenSTAADUI (1.0) and check this option.
  7. Click OK.
Now, you can set objects to the OpenSTAAD classes using this reference.

You can also now view the OpenSTAADUI object contents (classes and functions) in the Object Browser, by selecting the Object Browser tool () in the VBA Editor.