Simon Goodman
New member
I am developing a macro, contained within an Excel workbook (call it WB1). Via an auto-open process, it starts another Excel workbook (WB2). The auto-open process of WB2 then runs. At the end, it writes a value to the Registry.
When completed, control returns to WB1. This reads the Registry value, and acts on that result.
However, I have some kind of timing issue, and somewhere in the process WB1 appears to be 'hanging', waiting for a value to be returned. I have time-out code, which is eventually executed.
If I place a MsgBox command immediately before checking the Registry value, the process completes correctly. As this is to be a process started by Task Scheduler via a batch job, this will not work in production.
I have tried all manner of sleeps, waits, etc. Nothing works apart from the MsgBox. So I'm looking for suggestions to either run the MsgBox virtually, with no real input required, or some way of running the Shell command in WB1, so that it waits for WB2 to complete before checking the Registry value for further action.
When completed, control returns to WB1. This reads the Registry value, and acts on that result.
However, I have some kind of timing issue, and somewhere in the process WB1 appears to be 'hanging', waiting for a value to be returned. I have time-out code, which is eventually executed.
If I place a MsgBox command immediately before checking the Registry value, the process completes correctly. As this is to be a process started by Task Scheduler via a batch job, this will not work in production.
I have tried all manner of sleeps, waits, etc. Nothing works apart from the MsgBox. So I'm looking for suggestions to either run the MsgBox virtually, with no real input required, or some way of running the Shell command in WB1, so that it waits for WB2 to complete before checking the Registry value for further action.