run excel macro from access (report)button
I have a button on a form in Access which previews a report. My problem is I have to refresh my data first via Excel Macro to update a linked table(s). I currently switch to excel to run macro, when complete I return to Access and preview the report.
How can I call the macro from my Personal.xls and when complete, return to access to complete the rest of the code to preview the report.
Access 97 code for report button:
Private Sub Command8_Click()
On Error GoTo Err_Command8_Click
Dim stDocName As String
stDocName = "FULL INTRANSIT Report"
DoCmd.OpenReport stDocName, acNormal
I figure if it was placed at the beginning of my code for the button it would call up the macro and run it and then move on when complete. But this is the syntax I use in a workbook code that calls a macro.
This is the name of my Macro:
please help, it would save me so much time and ensure my data is refreshed.