I am opening an excel 2000 workbook in VB6 and I need it to run an macro on open?

How do I do this?  I have it set for Auto_Open and that doesn't work.  Workbook_open didn't work either.  The macro I need to open refreshes data from data sources.
sjmmajorAsked:
Who is Participating?
 
RanjeetRainConnect With a Mentor Commented:
Dim XL As Object
Set XL = CreateObject("excel.Application")
With XL.Application
    XL.Visible = True
    XL.Run "Your_Macro_Name_Here"
    XL.Quit
End With

Set XL = Nothing
0
 
RanjeetRainCommented:
Kickstart the macro yourself.
0
 
sjmmajorAuthor Commented:
It worked!!  Thanks
0
All Courses

From novice to tech pro — start learning today.