Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro that waits, then resumes after window is closed
Does anyone know how to do the following:
I have a macro that does some things including open up a workbook, then I need the macro to wait until this workbook is closed while I edit some values, then proceed with the rest of the macro. Any ideas? Thank you all in advance. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro that waits, then resumes after window is closed
You will need 2 macros, one that opens the workbook and stops, and then trap
the BeforeClose event of that workbook. -- HTH RP (remove nothere from the email address if mailing direct) wrote in message ups.com... Does anyone know how to do the following: I have a macro that does some things including open up a workbook, then I need the macro to wait until this workbook is closed while I edit some values, then proceed with the rest of the macro. Any ideas? Thank you all in advance. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro that waits, then resumes after window is closed
How do you 'stop' in VBA?
If you Exit Sub, then how do you get going again? If you find better than this, please let me know: Sub Main() ' (XL97/WIN98) Dim WBName$, i% Workbooks.Add WBName = ActiveWorkbook.Name MsgBox "Just opened " & Workbooks(WBName).Name Do While XLWinStat(WBName) ' this is the 'wait' loop ' the for..next is to not hog the system For i = 1 To 1000: DoEvents: Next i Loop MsgBox WBName & " is closed. Am proceeding ..." End Sub Function XLWinStat%(WBName$) On Error GoTo XLWSerr If Workbooks(WBName).Name = WBName Then XLWinStat = 1: Exit Function End If Stop ' never gets here XLWSerr: ' gets here when WBName is closed End Function Bob wrote: You will need 2 macros, one that opens the workbook and stops, and then trap the BeforeClose event of that workbook. michael wrote Does anyone know how to do the following: I have a macro that does some things including open up a workbook, then I need the macro to wait until this workbook is closed while I edit some values, then proceed with the rest of the macro. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro that waits, then resumes after window is closed
ignore please
--ron |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
closed workbook macro | Excel Discussion (Misc queries) | |||
how to get alert message when window is closed in excel for blank | Excel Discussion (Misc queries) | |||
Project still in "project explorer" window after file closed down! | Excel Programming | |||
Project still in "project explorer" window after file closed down! | Excel Programming | |||
Run a Macro over a Closed Workbook?? | Excel Programming |