Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Launch Excel vba macro from Access?
Can anyone provide a simple way to call a piece of VBA code in an Excel
spreadsheet, from within VBA in an Access project? I have a rather long winded approach of opening the spreadsheet via a command shell in Access, and passing in command line parameters that then trigger code in the auto_open() code...but I'm hoping for something a bit simpler?! Cheers, Rob |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Launch Excel vba macro from Access?
This is how I do it from powerpoint - should work in
Access as well. regards Sean Sub Main() Dim appXL As Excel.Application Set appXL = New Excel.Application appXL.Visible = True appXL.Workbooks.Open "D:\???\xxx\fn.xls" appXL.Run ("sDriver") ' run the excel macro appXL.ActiveWorkbook.Save appXL.Quit ActivePresentation.Save Application.Quit End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Launch Excel vba macro from Access?
Perfect!
Thanks Sean. "Sean McPoland" wrote: This is how I do it from powerpoint - should work in Access as well. regards Sean Sub Main() Dim appXL As Excel.Application Set appXL = New Excel.Application appXL.Visible = True appXL.Workbooks.Open "D:\???\xxx\fn.xls" appXL.Run ("sDriver") ' run the excel macro appXL.ActiveWorkbook.Save appXL.Quit ActivePresentation.Save Application.Quit End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Auto Launch of Macro | Excel Discussion (Misc queries) | |||
launch any file type from excel macro | Excel Programming | |||
How do I Launch a Macro on a different sheet | Excel Programming | |||
Can you use an IF statement to launch a macro? | Excel Programming | |||
Launch Macro in Access via Macro running in Excel??? | Excel Programming |