PC Review


Reply
Thread Tools Rate Thread

Auto_open from Worksheet Object Code

 
 
Stuart
Guest
Posts: n/a
 
      19th Oct 2007
All,

I am developing a sort of disclaimer sheet that 'veryhides' all sheets
in a model on workbook_open, requiring a user to agree to a disclaimer
before the sheets are then unhidden.

The aim is to distribute the disclaimer sheet as a single worksheet
that can be copied into any spreadsheet, and work pretty much
immediately.

The problem i am hitting is i can't find a way to replicate the
workbook_open/auto_open event purely with code contained in the
worksheet object.

Q1) Is it impossible?

My fall back is to use an auto_open routine in a module, and create an
installation .xls that will

a) copy the sheet across
b) copy the module across

but

Q2) I don't know how to copy a module from one workbook to another in
code
Q3) I don't know how to check (in code) first that the destination
workbook doesn't already have an auto_open routine, or what to do
about it if it does!

ANY help on Q1,2, or 3 very very much appreciate.

Cheers,

Stu

 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      19th Oct 2007
Q1. I don't think you'll find any worksheet event that's always going to fire
when the workbook opens.

Q2. I'd start by reviewing Chip Pearson's site:
http://cpearson.com/excel/vbe.aspx

Q3. Check Chip's site for: "Searching A Module For Text"

But writing code to change code is fraught with problems. (Depending on the
version of excel...) If the user doesn't allow access to the workbook's project,
your code will fail. If the project is protected, then there isn't a reliable
way to unprotect that project via code.





Stuart wrote:
>
> All,
>
> I am developing a sort of disclaimer sheet that 'veryhides' all sheets
> in a model on workbook_open, requiring a user to agree to a disclaimer
> before the sheets are then unhidden.
>
> The aim is to distribute the disclaimer sheet as a single worksheet
> that can be copied into any spreadsheet, and work pretty much
> immediately.
>
> The problem i am hitting is i can't find a way to replicate the
> workbook_open/auto_open event purely with code contained in the
> worksheet object.
>
> Q1) Is it impossible?
>
> My fall back is to use an auto_open routine in a module, and create an
> installation .xls that will
>
> a) copy the sheet across
> b) copy the module across
>
> but
>
> Q2) I don't know how to copy a module from one workbook to another in
> code
> Q3) I don't know how to check (in code) first that the destination
> workbook doesn't already have an auto_open routine, or what to do
> about it if it does!
>
> ANY help on Q1,2, or 3 very very much appreciate.
>
> Cheers,
>
> Stu


--

Dave Peterson
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto_Open Code on Worksheet Tony Microsoft Excel Programming 2 29th May 2009 12:02 PM
How can I locate image code in a worksheet object JT Microsoft Excel Programming 1 24th Sep 2008 05:25 AM
Sub Auto_Open() - Sheet name - error code transferxxx@gmail.com Microsoft Excel Programming 9 12th Sep 2006 01:18 PM
Auto_Open Select Worksheet =?Utf-8?B?UGhpbCBI?= Microsoft Excel Programming 2 27th Jun 2006 10:49 AM
Disabling Auto_Open in distributed worksheet =?Utf-8?B?RGF2ZUY=?= Microsoft Excel Programming 1 17th Jun 2006 09:52 PM


Features
 

Advertising
 

Newsgroups
 


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