Link to home
Start Free TrialLog in
Avatar of iamadamc
iamadamc

asked on

Calling Excel Macro (Sub) from Visual Basic 6.0

Please advise how to call a macro (sub) in Excel (Office XP) from a Visual Basic 6.0 Script.  Thx! - Adam
ASKER CERTIFIED SOLUTION
Avatar of Diveblue
Diveblue

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mango2
Mango2

Set ApExcel = CreateObject("Excel.application")
'Creates an object
    ApExcel.Visible = True ' So you can see Excel
    ApExcel.Workbooks.Open FileName:=gstrMacroPath
    ApExcel.Application.Run "auto_open"
    ApExcel.Application.Quit