Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default 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
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
IF formula misbehaving with determining year of an event Pierre Excel Worksheet Functions 3 April 24th 08 03:23 PM
Misbehaving Tab cynlee Excel Worksheet Functions 1 April 3rd 08 05:21 PM
AutoFilter May be Misbehaving Marsh New Users to Excel 7 November 22nd 06 01:48 PM
Workbook Misbehaving bkworks Excel Discussion (Misc queries) 2 August 8th 06 04:09 PM
excel misbehaving R..VENKATARAMAN Excel Discussion (Misc queries) 2 February 19th 06 02:52 AM


All times are GMT +1. The time now is 12:13 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"