AfterUpdate Event for ODC Refresh process

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-com:office:office" /><o:p></o:p>
<o:p></o:p>
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:p></o:p>
<o:p></o:p>
I've tried refreshing with these codes: <o:p></o:p>
1. Option 1<o:p></o:p>
ActiveWorkbook.Connections("NAMEofconnection").Refresh <o:p></o:p>
2. Option 2<o:p></o:p>
Sheets("NameOFsheet").Select <o:p></o:p>
Application.Goto Reference:="NAMEofconnection"<o:p></o:p>
Selection.ListObject.QueryTable.Refresh BackgroundQuery:=True<o:p></o:p>
Sheets("Ctes").Select<o:p></o:p>
<o:p></o:p>
Both work and refresh the data.<o:p></o:p>
<o:p></o:p>
I can't see anyway of notification of the update been finished. Or a way to set up a progress bar<o:p></o:p>
<o:p></o:p>
I have tried MS: http://support.microsoft.com/kb/213187 but it does work. <o:p></o:p>
<o:p></o:p>
One funny thing, I've tried this code to get the count of QueryTables: <o:p></o:p>
For Each w In Application.Worksheets<o:p></o:p>
Debug.Print w.Name, w.QueryTables.Count<o:p></o:p>
Next w<o:p></o:p>
<o:p></o:p>
And got 0(zero) for every sheet... (???)<o:p></o:p>
<o:p></o:p>

At the end, what I'm trying to do is this: <o:p></o:p>
  • Click a button for a form to be open. But the close button will be disable. <o:p></o:p>
  • This form will trigger the refresh, automatically. <o:p></o:p>
  • Also, the start time will be updated. <o:p></o:p>
  • Once the refresh process is finished I want to update the form with the end time. <o:p></o:p>
  • And finally, update the form with the quantity of record brought over and the duration of the process. And enable the close button. <o:p></o:p>
<o:p></o:p>
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:p></o:p>
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top