Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
Before a workbook is closed I want to give user the option of opening another one. Private Sub Workbook_BeforeClose(Cancel As Boolean) if Msgbox("Do you need to open 'Data2.xls'", vbYesNo) = vbYes then workbooks.open "C:\Data\Date2.xls" End if End Sub The problem is that while the second workbook Data2 is opened ok, the original workbook which this code is in does not close. I don't understand this as it's in a BeforeClose sub I've tried putting Else ThisWorkbook.close in, but this causes the message box to be displayed all over again. Please Help |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Colon at the end of excel file name(ex: problem.xls:1, problem.xls | New Users to Excel | |||
Wierd one concerning Before_Close and OnTime | Excel Discussion (Misc queries) | |||
Started out as an Access problem. Now an Excel problem | Excel Discussion (Misc queries) | |||
problem with a conditional max problem | Excel Discussion (Misc queries) | |||
Auto_Open & Before_Close | Excel Programming |