Is there a way to run an existing Access macro from TDP? When I connect to the db I do not see the existing queries, macros, or modules.
See if you using the MS Access AutoExec functionality may meet your needs…
In your Execution Target tab put the following in:
Target: This is the path to your MSACCESS.EXE program.
C:\Program Files\Microsoft Office\Office15\msaccess.exe
Command-Line Parameters:“C:\My Documents\MyDatabase\Customers.accdb” /x “Name_OF_Your_MACRO”
This is the path to your access database. You need to put the quotes in there.
Just remember, when the macro is run, should have an entry in there to exit access when the macro has completed. Otherwise, Access will just stay open.
You can also execute a vbscript using Toad to launch macros !
I use to do that with Excel to format exported data in .xlsx files. No need to share files with macros (more secure)…
for example : a file named “excel_launcher.vbs”
On Error Resume Next
Set ApplicationExcel = CreateObject(“Excel.Application”)
Set ClasseurExcel = ApplicationExcel.Workbooks.Open(“C:\Test\MonFichierExcel.xlsm”) ‘or .xlam for macro container without worksheets’
ApplicationExcel.Visible = false
Set ClasseurExcel = Nothing
Set ApplicationExcel = Nothing
in a “run program” activity
Program : C:\Windows\System32\wscript.exe
Arguments : “C:\MyFolder\excel_launcher.vbs”
Run Directory : C:\MyFolder
I hope this help…
Beside isolated solutions as others already mentioned here, there is also an officially supported way how to do this simply by using the Export wizard where once you choose Excel as output and specify an existing “Macro enabled file” (.xlsm file extension) then a special Export Wizard page with “Before and After export macros” opens so you can specify which existing macros (public parameterless vba procedures) to execute.