Roberto,
I can confirm the behavior you describe. It looks like a bug to me. I can't
think of a good work around. Sorry.
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
"Roberto" wrote in message
...
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