hvangelder
New Member
- Joined
- Sep 1, 2011
- Messages
- 1
I've tried everything I found on www.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
<o></o>
This is the setup. I am running Excel 2010. I have set up a database connection to an ACCESS db to query 1 table, with an ODC file, which in turn is the input for a lot of pivot tables and calculations within the sheet.<o></o>
<o></o>
I've tried refreshing with these codes: <o></o>
1. Option 1<o></o>
ActiveWorkbook.Connections("NAMEofconnection").Refresh <o></o>
2. Option 2<o></o>
Sheets("NameOFsheet").Select <o></o>
Application.Goto Reference:="NAMEofconnection"<o></o>
Selection.ListObject.QueryTable.Refresh BackgroundQuery:=True<o></o>
Sheets("Ctes").Select<o></o>
<o></o>
Both work and refresh the data.<o></o>
<o></o>
I can't see anyway of notification of the update been finished. Or a way to set up a progress bar<o></o>
<o></o>
I have tried MS: http://support.microsoft.com/kb/213187 but it does work. <o></o>
<o></o>
One funny thing, I've tried this code to get the count of QueryTables: <o></o>
For Each w In Application.Worksheets<o></o>
Debug.Print w.Name, w.QueryTables.Count<o></o>
Next w<o></o>
<o></o>
And got 0(zero) for every sheet... (???)<o></o>
<o></o>
At the end, what I'm trying to do is this: <o></o>
The reason I need these, is that I need to monitor the time it's taking so I can analyze the sizing of the whole app running in Excel.<o></o>
<o></o>
This is the setup. I am running Excel 2010. I have set up a database connection to an ACCESS db to query 1 table, with an ODC file, which in turn is the input for a lot of pivot tables and calculations within the sheet.<o></o>
<o></o>
I've tried refreshing with these codes: <o></o>
1. Option 1<o></o>
ActiveWorkbook.Connections("NAMEofconnection").Refresh <o></o>
2. Option 2<o></o>
Sheets("NameOFsheet").Select <o></o>
Application.Goto Reference:="NAMEofconnection"<o></o>
Selection.ListObject.QueryTable.Refresh BackgroundQuery:=True<o></o>
Sheets("Ctes").Select<o></o>
<o></o>
Both work and refresh the data.<o></o>
<o></o>
I can't see anyway of notification of the update been finished. Or a way to set up a progress bar<o></o>
<o></o>
I have tried MS: http://support.microsoft.com/kb/213187 but it does work. <o></o>
<o></o>
One funny thing, I've tried this code to get the count of QueryTables: <o></o>
For Each w In Application.Worksheets<o></o>
Debug.Print w.Name, w.QueryTables.Count<o></o>
Next w<o></o>
<o></o>
And got 0(zero) for every sheet... (???)<o></o>
<o></o>
At the end, what I'm trying to do is this: <o></o>
- Click a button for a form to be open. But the close button will be disable. <o></o>
- This form will trigger the refresh, automatically. <o></o>
- Also, the start time will be updated. <o></o>
- Once the refresh process is finished I want to update the form with the end time. <o></o>
- And finally, update the form with the quantity of record brought over and the duration of the process. And enable the close button. <o></o>
The reason I need these, is that I need to monitor the time it's taking so I can analyze the sizing of the whole app running in Excel.<o></o>