Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Database problem to be solved... Please help! | Excel Discussion (Misc queries) | |||
My Mutual Fund Questions(s), Solved?? | Excel Worksheet Functions | |||
solved problem | Excel Worksheet Functions | |||
Can this be solved? or am i dealing with circular reasoning? | Excel Discussion (Misc queries) | |||
Excel/Web bug solved!!! | Excel Programming |