![]() |
Refresh from Access not working
I have an excel spreadsheet (called "2009info") that is linked to an Access
database. Even though the connection properties specify that this should refresh the data upon opening, it does not refresh unless I manually select the refresh button. I have a macro that I'm using to do various things with this spreadsheet and several others so I used the following command in the macro to avoid having to manually refresh it upon opening: ActiveWorkbook.RefreshAll This command works fine if I step through the macro but it does not work when I generate the macro by simply running it. I don't get an error but it does not do the refresh. Does anyone know why this would be happening and what I can do to get around it? |
Refresh from Access not working
hi
try this instead.... Private Sub Workbook_Open() Sheets("2009info").Range("A1").QueryTable.Refresh _ BackgroundQuery:=False End Sub regards FSt1 "klav" wrote: I have an excel spreadsheet (called "2009info") that is linked to an Access database. Even though the connection properties specify that this should refresh the data upon opening, it does not refresh unless I manually select the refresh button. I have a macro that I'm using to do various things with this spreadsheet and several others so I used the following command in the macro to avoid having to manually refresh it upon opening: ActiveWorkbook.RefreshAll This command works fine if I step through the macro but it does not work when I generate the macro by simply running it. I don't get an error but it does not do the refresh. Does anyone know why this would be happening and what I can do to get around it? |
All times are GMT +1. The time now is 02:11 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com