VBA: Refreshing a shared workbook from internet

TomCon

Active Member
Joined
Mar 31, 2011
Messages
268
Office Version
365
Platform
Windows, Mobile
I have a workbook on OneDrive that is shared. The workbook is open both on my PC and on my Android phone and i update it from both places.

When i'm on my PC, i hit the Save button and that updates any changes from the Android copy...but it takes a few seconds. There is some latency.

Eventually i run a macro (on the PC side) to process the data in a certain way. The first thing i do in the macro is Save, in attempt to update the Windows version with any changes from the Android side, like this:
Windows("D4p-Enter.xlsx").Activate
ActiveWorkbook.Save

But, it appears to me that the update is actually not finished upon completion of executing the ActiveWorkbook.Save line (I am guessing presumably due to latency in update), but the macro code moves forward right after the save line to the next code line, and so now the macro does not process the data (from the Android copy) that i need to be there before the macro continues.

Is there a "smart" way to have my macro pause until any new data that may have been in the Android side is updated into the workbook, and at that time code could continue to execute? I suppose i could have it pause for a set number of seconds, but that would be a bit unreliable.

Thanks!
 

Some videos you may like

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Watch MrExcel Video

Forum statistics

Threads
1,102,369
Messages
5,486,449
Members
407,547
Latest member
Sankarasrinivas

This Week's Hot Topics

Top