R
Roberto
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
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