LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Workbook Open bypasses Query Refresh

I have a workbook "B.xls" that when opened, I need a linked query
refreshed. This is now manually done by choosing the "Enable automatic
refresh" button on the Query refresh dialogue box that pops up when
the file is opened manually.

I have added code in workbook A.xls behind a button that opens
workbook B.xls. Works fine EXCEPT that the query DOES NOT get
refreshed and no dialogue box pops up.

Can anyone suggest code to add to my workbook.open that will run the
query refresh?

Dim wkbk As Workbook

On Error Resume Next
Set wkbk = Workbooks("B.xls")
On Error GoTo 0
If wkbk Is Nothing Then
Set wkbk = Workbooks.Open(Filename:="C:\Data\ClientName\B.xls ")
End If

Thanks
Dennis

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to open after auto refresh(Query) Irmann Excel Discussion (Misc queries) 0 January 8th 08 06:33 AM
Refresh Ext Date Range Query with workbook closed? (Exc2003) Finny388 Excel Programming 1 November 24th 07 02:20 AM
Refresh business query on open SITO Excel Discussion (Misc queries) 1 August 15th 06 02:57 PM
Auto Open file VBA Refresh MS Query Save Close gcutter[_2_] Excel Programming 2 September 26th 05 03:07 PM
Supress Query Refresh dialog on opening workbook Paul Tugwell Excel Programming 1 August 8th 05 11:27 PM


All times are GMT +1. The time now is 05:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"