Hi,
I am not sure about the error message. An error message would be shown if you try to run the macro without opening any STAAD model. In general, if you use the application object, first open the relevant STAAD file and then run the macro. You can also specify the full path of the STAAD model that you want to analyze.