Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All
I've got the following code in the "ThisWorkbook" code object. Option Explicit Public WithEvents App As Application Private Sub App_WorkbookBeforeClose(ByVal Wb As Workbook, Cancel As Boolean) Cancel = False If Left(Wb.Name, 4) < "Book" Then MsgBox "beep" Cancel = True Exit Sub End If End Sub Public Sub SetApp() Set App = Application End Sub and in another module ThisWorkbook.SetApp the problem i'm having is that the "App" object clears as soon as focus returns to the calling module. Anyone have any idea why, i'm at a complete loss on this one. cheers Keith |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel screen capture to capture cells and row and column headings | Excel Discussion (Misc queries) | |||
why do all excel worksheets/workbooks close when I close one? | Excel Discussion (Misc queries) | |||
Not close thead when I close excel | Excel Programming | |||
Excel shoud not close all active books when clicking close button | Excel Discussion (Misc queries) | |||
excel - Windows close button (x) should only close active workboo. | Setting up and Configuration of Excel |