Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Programming using Visual Basic

Status
Not open for further replies.

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.
 
Replies continue below

Recommended for you

I have answered in your duplicate thread on Tek-Tips

Good Luck
johnwm
________________________________________________________
To get the best from these forums read faq731-376 before posting

Steam Engine enthusiasts:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor