Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default is it possible to run a macro automatically?

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

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default is it possible to run a macro automatically?

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default is it possible to run a macro automatically?

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)

"Neil" wrote in message
...
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 spreadsheet
End Sub



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
How do you do the following using VBA macro automatically? LunaMoon Excel Discussion (Misc queries) 1 May 4th 10 08:37 PM
Macro to automatically run Pam C Excel Discussion (Misc queries) 1 May 5th 05 02:35 PM
Run macro automatically. Excel macro New Users to Excel 7 April 19th 05 04:01 PM
Automatically run Macro tamato43 Excel Discussion (Misc queries) 0 March 30th 05 03:51 PM
macro to run automatically Dave Peterson[_3_] Excel Programming 0 July 31st 03 04:11 AM


All times are GMT +1. The time now is 08:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"