is it possible to run a macro automatically?

  • Thread starter Thread starter shirley
  • Start date Start date
S

shirley

i would like the macro to run automatically as soon as thw workbook i
open. this is to prevent ppl from disabling the workbook. how do i d
so
 
Shirley,

Here is the code you need. Rob Van Gelder posted it in a reply to myself in the post below yours

Private Sub Workbook_Open(
'code you want to run when they open the spreadshee
End Su
 
Hi Shirley,

To expand on the disabling bit, here is a response I posted yesterday.

Usual way is to put a message on one sheet that says that the user must run
with Macros enabled. Hide all the other sheets (use xlVeryHidden so that it
cannot be changed in Excel). In the Workbook_Open event add some code to
hide that sheet, and un hide all others. If they don't enable macros, your
macro won't fire, so they only see the warning sheet. Add code in the
Before_Close event to unhide the warning
sheet, and very hide the others

It isn't foolproof, but it should help.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Back
Top