Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

run excel makro on open workbook 1

Status
Not open for further replies.

cspm2003

Programmer
Nov 24, 2004
78
DE
Hi, I have a little problem which should be to hard to solve. I allready searched the forum and found some stuff, but not all that I need.

Heres my situation: I have an excel workbook which is allways open. The workbook contains a makro which I want to call from a vbscript.

I messed around with this code but couldnt really come up with the solution:

Code:
Set objExcel = createobject("Excel.application")
objexcel.Visible = True
objexcel.Workbooks.open "C:\Dokumente und Einstellungen\messmer\Desktop\scripte\VBA\Excel\Strahl\echtSystem\test\auswertung.xls"
objexcel.Application.Run "letsGo"
objexcel.Quit

What code would I use to run the makro on an allready opened workbook?
 
To get an already running instance of Excel:
Set objExcel = GetObject(, "Excel.Application")


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top