View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
FSt1 FSt1 is offline
external usenet poster
 
Posts: 3,942
Default 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?