![]() |
Chip, I solved it
Hi
You may remember I had a before_close problem in that when opening another workbook the original workbook remained open? And if I put a thisworkbook.close in, then it made the message box appear twice. Private Sub Workbook_BeforeClose(Cancel As Boolean) If MsgBox("Do you want to open Data2", vbYesNo) = vbYes Then Workbooks.Open "C:\Windows\Desktop\Data2.xls" end if However I solved the above problem by using an idea from another post. Public CloseMe Private Sub Workbook_Open() CloseMe = False End Sub Private Sub Workbook_BeforeClose(Cancel As Boolean) Select Case CloseMe Case False CloseMe = True If MsgBox("Do you want to open Data2", vbYesNo) = vbYes Then Workbooks.Open "C:\Windows\Desktop\Data2.xls" ThisWorkbook.Close Else CloseMe = True Application.Quit End If End Select End Sub Cheers Roberto |
All times are GMT +1. The time now is 05:08 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com