A troubling issue with external links update and workboon_open macro

A

Alseikhan

I have a troubling issue with simultaneous execution of external link
update and workbook_open macro.
The Excel workbook has a range of cells (a table of 85 rows and 2
columns) whose cells contain formulas that link to a remote server t
download stocks data.
The workbook_open macro executes code that depends on content of thes
cells in order to setup range names and some other calculations.
The problem is that full update of external links takes a few seconds
which is too log and causes the workbook_open macro to crash upo
opening because not all cells have updated yet.
What is needed is a way to force the macro to wait until all externa
links are updated (but without tying up computer processor time whic
would slow external data updating time and speed).

Any help?
thank you.

Alseikha
 
C

Chip Pearson

I haven't tried this, so it may not work, but I think it should.
Take all the code out of you Workbook_Open procedure and put it
in a procedure named MyMacro (or whatever) in a standard code
module. Then in Workbook_Open, use


Application.OnTime Now, "MyMacro", , True

OnTime will delay while Excel is performing all its startup tasks
(including updating links), and then run the macro named
"MyMacro".


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"Alseikhan"
message
news:[email protected]...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top