Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Misbehaving 'Worksheet_Open()' Event
I have some code in the 'Workbook_Open()' Event to unprotect a worksheet when the workbook opens.
It does what's expected of it when the workbook is opened 'manually', but I'm surprised & distressed to find that it doesn't work when the workbook is opened programmaticaly (i.e. Workbooks.Open "filename"). I'm using Excel 97. Is this unique to me, Excel 97, or all versions of Excel? Can anyone shed some light? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Misbehaving 'Worksheet_Open()' Event
If you are opening the workbook programmatically by using a shortcut key
combination that includes a Shift key, then that is the source of the problem. Make the shortcut combination just control and a lowercase letter. Unlike Auto_Open, the Workbook_Open event will fire when the file is opened programmatically unless events have been disabled. -- Regards, Tom Ogilvy "James" wrote in message ... I have some code in the 'Workbook_Open()' Event to unprotect a worksheet when the workbook opens. It does what's expected of it when the workbook is opened 'manually', but I'm surprised & distressed to find that it doesn't work when the workbook is opened programmaticaly (i.e. Workbooks.Open "filename"). I'm using Excel 97. Is this unique to me, Excel 97, or all versions of Excel? Can anyone shed some light? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Misbehaving 'Worksheet_Open()' Event
Thanks Tom
Unfortunately I'm not using a shortcut key - it's just a straightforward Sub in a standard code module The code is executing perfectly except for unprotect the worksheet Any other offers? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Misbehaving 'Worksheet_Open()' Event
The code is executing perfectly except for unprotect the worksheet.
That isn't what you said originally: that it doesn't work when the workbook is opened programmaticaly (i.e. Workbooks.Open "filename"). So it would be hard to make any additional offers unless someone just wanted to guess at what the real situation is. -- Regards, Tom Ogilvy "James" wrote in message ... Thanks Tom. Unfortunately I'm not using a shortcut key - it's just a straightforward Sub in a standard code module. The code is executing perfectly except for unprotect the worksheet. Any other offers? |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Misbehaving 'Worksheet_Open()' Event
A Workbook_Open() event cannot be in a standard module. Perhaps that is the
source of your problem. -- Vasant "James" wrote in message ... Thanks Tom. Unfortunately I'm not using a shortcut key - it's just a straightforward Sub in a standard code module. The code is executing perfectly except for unprotect the worksheet. Any other offers? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
IF formula misbehaving with determining year of an event | Excel Worksheet Functions | |||
Misbehaving Tab | Excel Worksheet Functions | |||
AutoFilter May be Misbehaving | New Users to Excel | |||
Workbook Misbehaving | Excel Discussion (Misc queries) | |||
excel misbehaving | Excel Discussion (Misc queries) |