Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Database problem to be solved... Please help! Nick M. Excel Discussion (Misc queries) 2 September 13th 08 01:02 AM
My Mutual Fund Questions(s), Solved?? Crackles McFarly Excel Worksheet Functions 1 August 22nd 07 06:14 AM
solved problem claude Excel Worksheet Functions 1 July 7th 06 08:14 PM
Can this be solved? or am i dealing with circular reasoning? Nietz Excel Discussion (Misc queries) 1 February 16th 06 12:02 AM
Excel/Web bug solved!!! Paul Excel Programming 0 August 28th 03 08:11 PM


All times are GMT +1. The time now is 03:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"