Wait for SQL download in Excel sheet

Hans810

Board Regular
Joined
Dec 1, 2005
Messages
63
Dear All,
I am working with Exact software, which is working with SQL database.
From the Exact database we can load data into an Excel sheet by putting a querie in a cell, say A5 (we usually use A5 for that purpose)
The querie is started from VBA code:

Set ctlMenuItem = CommandBars("Exact Globe Next").Controls(6) ' that is button 6 from the Excat AddIn
Sheets("DATA").Select
Range("A5").Select
ctlMenuItem.Execute

Btw: The AddIn of Exact has been installed in the menu bar of Excel!

Till recently this worked perfectly for many years.
Recently the procedure generates errors or gives no data at all. Or only the header line repeatedly..
The next VBA command after the "ctlMenuItem.execute" command is not waiting for the database data to be loaded in my sheet "Data".
How can I be sure that data is loaded properly, i.e. can I put some wait command or so ? I mean wait till the data from the database is loaded, and after that proceed in the VBA programm.

Thanks in advance for your answer.
Greetings from Holland!
 

Some videos you may like

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

Watch MrExcel Video

Forum statistics

Threads
1,122,364
Messages
5,595,722
Members
414,013
Latest member
tnobbs

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
Top