I have made a vb program (listed below), it runs well inside object browser, but when i run it from usertools (i.e assigning it to the usertools) it shows error.
error: 10092 Activex automation, cannot create object.
code:
Sub Main()Dim oStd As ObjectSet oStd = GetObject(,"StaadPro.OpenSTAAD")Dim stdFile As StringoStd.GetSTAADFile(stdFile,"TRUE")If stdFile = "" ThenMsgBox "This macro can only be run with a valid STAAD file loaded.", vbOkOnlyElsestdFile = Left (stdFile, Len (stdFile)-4) & ".ANL"Dim Myexcel As New Excel.ApplicationMyexcel.Workbooks.OpenText(Filename:=stdFile, StartRow:=1, DataType:=Excel.XlTextParsingType.xlDelimited, TextQualifier:=Excel.XlTextQualifier.xlTextQualifierNone, ConsecutiveDelimiter:=True, Tab:=False, Semicolon:=False, Comma:=False, Space:=True, Other:=False)Myexcel.ActiveSheet.Name = "Sheet1"Myexcel.Visible = TrueEnd IfSet oStd = NothingEnd Sub