VBA code to refresh Access 2007 Query worksheet before copy to another workbook

DThib

Active Member
Joined
Mar 19, 2010
Messages
464
Office Version
  1. 365
Platform
  1. Windows
I am pulling my hair out on this.

MY query worksheet opens and instead of updating the query results, it copies immediately and places in the other workbook.

I cannot figure out a timer to wait for the query to finish before copying.
It's not worth placing the code since I have been manipulating in many different ways to make this work.

Help!

DThib
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Anyone have an idea of where a delay might go to allow this?

DThib
 
Upvote 0
OK, Since no one is answering , I am thinking that this may be the issue:

If I open the workbook directly the workbooks.open command runs the refresh macro for the query.
If I call from the main workbook for the workbook to open, I cannot get it to run the refresh the query macro.

Why? I cannot figure this one out?

DThib
 
Upvote 0

Forum statistics

Threads
1,223,693
Messages
6,173,868
Members
452,536
Latest member
Chiz511

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