N
nafflerbach
I have a table of data that changes daily and I need to update and save a
linked Excel spreadsheet with the new data. The spreadsheet is complex with
multiple tabs and formatting and therefore I cannot just export the table and
save. What I need to do from Access is open the Excel file, Refresh All and
then run one additional Excel Macro. Here is what I have so far but it fails
at the macro:
Dim objExcel As Object
Set objExcel = CreateObject("Excel.Application")
objExcel.Application.Workbooks.Open "\\File Name.xls"
objExcel.Application.Visible = True
‘Need to refresh data before macro runs, not able to refresh on open.
objExcel.Run "File Name.xls!RefreshMacro Name"
objExcel.Run "File Name.xls!Macro Name"
objExcel.Quit
Can anyone help?
linked Excel spreadsheet with the new data. The spreadsheet is complex with
multiple tabs and formatting and therefore I cannot just export the table and
save. What I need to do from Access is open the Excel file, Refresh All and
then run one additional Excel Macro. Here is what I have so far but it fails
at the macro:
Dim objExcel As Object
Set objExcel = CreateObject("Excel.Application")
objExcel.Application.Workbooks.Open "\\File Name.xls"
objExcel.Application.Visible = True
‘Need to refresh data before macro runs, not able to refresh on open.
objExcel.Run "File Name.xls!RefreshMacro Name"
objExcel.Run "File Name.xls!Macro Name"
objExcel.Quit
Can anyone help?