LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

If macros are disabled, then auto_open won't run.

This is a security measure. If you could bypass this level of security, then it
wouldn't be very useful.


One way around it is to use a dummy workbook that contains one worksheet and a
macro that opens the real workbook (and closes the dummy workbook).

Have the user open that. If macros are disabled, the macro won't run and the
user can see your warning on that single sheet: "Please open with macros
enabled!"

If the user opens with macros enabled, then the real file opens with its macros
enabled.

The macro could look like this:

Option Explicit
Sub auto_open()
Workbooks.Open Filename:="c:\my documents\excel\book2.xls"
ThisWorkbook.Close savechanges:=False
End Sub

Fernandoalberte wrote:

Guys,

When you open an excel file which has VB code in it, you are asked
(depening on your macro security settings) if you would like to disable
or enable macros.

Is there a way (perhaps via the auto_open code to stop this message
popping up and automatically enabling these macros?

Look forward to hearing your thoughts.

Regards,

Fernando

--
Fernandoalberte
------------------------------------------------------------------------
Fernandoalberte's Profile: http://www.excelforum.com/member.php...o&userid=24493
View this thread: http://www.excelforum.com/showthread...hreadid=383030


--

Dave Peterson
 
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
Macros and File Lost Kelli McCann Excel Discussion (Misc queries) 0 May 13th 05 12:40 AM
Enabling macros Pennington Excel Worksheet Functions 1 December 2nd 04 07:43 PM


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