jenvandiver
Registered User.
- Local time
- Today, 17:02
- Joined
- Oct 16, 2002
- Messages
- 56
I've coded a form button in Access to open an Excel template, which is supposed to automatically run a query for data on open, however when it opens using the button in Access, it doesn't automatically refresh the data and I have to manually do it. It works perfect if I double click directly on the template, but opening it through Access seems to disable the aumatic refresh.
So, at this point I'm trying to come up with language to add to the form button that will automatically run 2 macros (created in Excel) immediately after the form is opened. mcr1 is named RefreshData and mcr2 is AutoFitRows. Here is the code I have so far...(of course it isn't working!)
with oApp
.Workbooks.Open "C:\Documents and Settings\vandiverj\AMTPT\Training Tool\Templates\Comments Matrix.xlt"
ActiveWorkbook.RunAutoMacros xlRefreshData
With ActiveWorkbook
.RunAutoMacros xlRefreshData
End With
Thanks in advance for any help on this...
So, at this point I'm trying to come up with language to add to the form button that will automatically run 2 macros (created in Excel) immediately after the form is opened. mcr1 is named RefreshData and mcr2 is AutoFitRows. Here is the code I have so far...(of course it isn't working!)
with oApp
.Workbooks.Open "C:\Documents and Settings\vandiverj\AMTPT\Training Tool\Templates\Comments Matrix.xlt"
ActiveWorkbook.RunAutoMacros xlRefreshData
With ActiveWorkbook
.RunAutoMacros xlRefreshData
End With
Thanks in advance for any help on this...