I have a problem where I was trying to create a Macro to open a Excel dcoument from Access and run the Excel Macro, all from switchboard. And it works.
When I activate the Macro from Switchboard the Visual Basics screen appears and have have to press the play button for it to work. Is there anyway I can change it where visual basic runs the macro without me having to press the play button? Here is my code:
Sub MasterKey()
Dim XL As Object
Set XL = CreateObject("excel.Application")
With XL.Application
.Visible = True
.workbooks.Open "C:\Korea\MASTER MACRO.xls"
.Run "Aut
pen"
.Quit
End With
Set XL = Nothing
End Sub
I created a module with the above script, Then a Macro to run the module (OpenModule / Compile data), then added it to the switchboard as RunMacro / Complie Data.
What did I miss? Thanks.
When I activate the Macro from Switchboard the Visual Basics screen appears and have have to press the play button for it to work. Is there anyway I can change it where visual basic runs the macro without me having to press the play button? Here is my code:
Sub MasterKey()
Dim XL As Object
Set XL = CreateObject("excel.Application")
With XL.Application
.Visible = True
.workbooks.Open "C:\Korea\MASTER MACRO.xls"
.Run "Aut

.Quit
End With
Set XL = Nothing
End Sub
I created a module with the above script, Then a Macro to run the module (OpenModule / Compile data), then added it to the switchboard as RunMacro / Complie Data.
What did I miss? Thanks.