Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I launch a second workbook from within a macro. This macro must stop
executing until the second workbook is closed again. Version is Excel 2002. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Chris,
Try putting the instruction to open the second workbook in one procedure, e.g: '============= Public Sub Tester1() Workbooks.Open Filename:="Workbook2.xls" End Sub '<<============= Then put the remaining instructions in the second workbook's close event code, e.g.: '============= Private Sub Workbook_BeforeClose(Cancel As Boolean) 'Code to run when Workbook2 closes End Sub '<<============= --- Regards, Norman "Chris De Luyck" <Chris De wrote in message ... I launch a second workbook from within a macro. This macro must stop executing until the second workbook is closed again. Version is Excel 2002. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi:
try Do While ...Loop statement , Dim wbk As Workbook Sub test() Set wbk = Workbooks.Add On Error GoTo ErrorHandler Do While TypeName(wbk) = "Workbook" 'your code '.............. DoEvents Loop MsgBox "Workbooks is close" ErrorHandler: Set wbk = Nothing End Sub -- 天行健,君*以自強不息 地勢坤,君*以厚德載物 http://www.vba.com.tw/plog/ "Chris De Luyck" wrote: I launch a second workbook from within a macro. This macro must stop executing until the second workbook is closed again. Version is Excel 2002. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Another option is to issue a scheduled macro, using OnTime, to check if the
workbook is open, if so, reissue it again for a later time, if not, the rest of your code.. -- HTH Bob Phillips (remove nothere from email address if mailing direct) "chijanzen" wrote in message ... Hi: try Do While ...Loop statement , Dim wbk As Workbook Sub test() Set wbk = Workbooks.Add On Error GoTo ErrorHandler Do While TypeName(wbk) = "Workbook" 'your code '.............. DoEvents Loop MsgBox "Workbooks is close" ErrorHandler: Set wbk = Nothing End Sub -- ???,??????? ???,??????? http://www.vba.com.tw/plog/ "Chris De Luyck" wrote: I launch a second workbook from within a macro. This macro must stop executing until the second workbook is closed again. Version is Excel 2002. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can a macro be paused to allow input, then continue? | Excel Worksheet Functions | |||
VB code to continue macro | Excel Discussion (Misc queries) | |||
VBA codes for macro to continue | Excel Programming | |||
The way to continue do macro recording | Excel Programming | |||
Pause macro, add form button to sheet, continue macro when button clicked! | Excel Programming |