Emma123
Structural
- Jun 30, 2005
- 3
Hello
I am a structural engineer and not very familiar with programming languages. I wrote a program using Visual Basic. Then I made it into an *.exe file. Then when I try to run. If I am running in computers which is installed with visual basic or matlab it works. But when I try to run in some computers without Matlab or Visual Basic, I get an error message saying 'ActiveX component can't create object'. But in my commands I haven't use any create object command. Sometimes in computers installed with Visual Basic it also doesn't run and an error message comes highlighting -
Dim xl As Excel.Application
with error message 'user-defined cannot be recognised'. When I go to Project-References and tick the checkbox Microsoft Excel Object Library 10.0 and click O.K, the program runs.
The following is part of the program I consider should be wrong somewhere.
Dim xl As Excel.Application
Private Sub cmdcalcstiff_Click()
Set xl = New Excel.Application
xl.Workbooks.Add
ActiveSheet.Cells(1, 1).Value = 58
xl.Workbooks(1).SaveAs c:\Matrix.xls
xl.Workbooks(1).Close
xl.Quit
End Sub
Please somebody help me to run the *.exe file in any computers without any error messages all the time.
Thank you.
I am a structural engineer and not very familiar with programming languages. I wrote a program using Visual Basic. Then I made it into an *.exe file. Then when I try to run. If I am running in computers which is installed with visual basic or matlab it works. But when I try to run in some computers without Matlab or Visual Basic, I get an error message saying 'ActiveX component can't create object'. But in my commands I haven't use any create object command. Sometimes in computers installed with Visual Basic it also doesn't run and an error message comes highlighting -
Dim xl As Excel.Application
with error message 'user-defined cannot be recognised'. When I go to Project-References and tick the checkbox Microsoft Excel Object Library 10.0 and click O.K, the program runs.
The following is part of the program I consider should be wrong somewhere.
Dim xl As Excel.Application
Private Sub cmdcalcstiff_Click()
Set xl = New Excel.Application
xl.Workbooks.Add
ActiveSheet.Cells(1, 1).Value = 58
xl.Workbooks(1).SaveAs c:\Matrix.xls
xl.Workbooks(1).Close
xl.Quit
End Sub
Please somebody help me to run the *.exe file in any computers without any error messages all the time.
Thank you.