Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Must finish Refresh before copying data...

Status
Not open for further replies.

GoDawgs

MIS
Apr 1, 2002
670
US
Ok, my 3rd question from the same project. So far I have an Excel sheet that refreshes its data from a table, then after that I have code to copy this data into the body of an email and send it. Now I'm having trouble in between the two steps...basically the data refresh takes about 4 or 5 seconds, and I have the email being sent immediately after I tell the sheet to refresh...I'm sure you can figure out that this means that the email is sent before the refresh is finished, thus the wrong data. I've tried to put a delay in the code, but that doesn't work because the refresh pauses too. I've tried to do a loop between the two and check if the refresh is complete, but that doesn't work because it's happening in the background. The easiest way would be to have the email sent after cell A1 is updated basically, but I can't seem to set that up. Any help would be greatly appreciated as I'm sure there is some very easy way I'm just overlooking.

Kevin
 
Nevermind, I solved my own problem by reading my post again. Basically I just automatically run refreshes in the background, but this was one time when that didn't make sense, so I took it out of the background and problem solved.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top