Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I want Excel to check the data on every workbook that gets opened. If
certain criteria are met, then some processing will be carried out. I have set up the event Workbook_Open to run, and this gets triggered ok. I have a problem with this though. When I open an existing workbook with Excel not previously running, the open routine gets triggered twice. I guess that this is once for the PERSONAL.XLS workbook and then again for the actual workbook. This is a problem, as when it gets triggered the first time, the PERSONAL.XLS sheet is hidden so if I try to look at anything on the sheet, the code falls over. Any assistance would be appreciate... Rob |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Rob,
Assuming something similar to Chip's method: http://www.cpearson.com/excel/AppEvent.htm check if the window is visible first: Private Sub App_WorkbookOpen(ByVal Wb As Excel.Workbook) If Wb.Windows(1).Visible = True Then MsgBox "Application Event: WorkbookOpen: " & Wb.Name Else 'Do nothing ? End If End Sub NickHK "RobH" wrote in message oups.com... I want Excel to check the data on every workbook that gets opened. If certain criteria are met, then some processing will be carried out. I have set up the event Workbook_Open to run, and this gets triggered ok. I have a problem with this though. When I open an existing workbook with Excel not previously running, the open routine gets triggered twice. I guess that this is once for the PERSONAL.XLS workbook and then again for the actual workbook. This is a problem, as when it gets triggered the first time, the PERSONAL.XLS sheet is hidden so if I try to look at anything on the sheet, the code falls over. Any assistance would be appreciate... Rob |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Apr 27, 9:00 am, "NickHK" wrote:
Rob, Assuming something similar to Chip's method:http://www.cpearson.com/excel/AppEvent.htm check if the window is visible first: Private Sub App_WorkbookOpen(ByVal Wb As Excel.Workbook) If Wb.Windows(1).Visible = True Then MsgBox "Application Event: WorkbookOpen: " & Wb.Name Else 'Do nothing ? End If End Sub NickHK "RobH" wrote in message oups.com... I want Excel to check the data on every workbook that gets opened. If certain criteria are met, then some processing will be carried out. I have set up the event Workbook_Open to run, and this gets triggered ok. I have a problem with this though. When I open an existing workbook with Excel not previously running, the open routine gets triggered twice. I guess that this is once for the PERSONAL.XLS workbook and then again for the actual workbook. This is a problem, as when it gets triggered the first time, the PERSONAL.XLS sheet is hidden so if I try to look at anything on the sheet, the code falls over. Any assistance would be appreciate... Rob- Hide quoted text - - Show quoted text - Thanks NickHK, that worked a treat. Rob |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Checking whether .xls file was just opened from a template | Excel Programming | |||
Opening a workbook if not opened, going to it if already opened | Excel Programming | |||
Opening a workbook if not opened, going to it if already opened | Excel Programming | |||
Opening a workbook if not opened, going to it if already opened | Excel Programming | |||
Checking for who opened Excel | Excel Programming |