PC Review


Reply
Thread Tools Rate Thread

How can force enable macros to be able to open my workbook?

 
 
=?Utf-8?B?a2Nkb25hbGRzb24=?=
Guest
Posts: n/a
 
      5th Dec 2005
I would like to be able to force employees to enable macros for a certain
workbook or it will not let them open the workbook. And maybe put a password
on it so if i would like to modify the workbook without the macros enabled.
 
Reply With Quote
 
 
 
 
Bob Umlas
Guest
Posts: n/a
 
      5th Dec 2005
set up the workbook so that the only sheet showing is one with a message
which says "You must enable macros for this workbook to work." in a large
obvious font. Have the workbook password protected and all sheets
veryhidden.
In the workbook_Open event, hid that message-sheet & display the sheets
which you'd need to have visible.
So, if the user disables macros all they see is a sheet with a message on
it; If the open it with macros enabled, the Open event will kick in and make
the workbook work the way you want.
Bob Umlas
Excel MVP

"kcdonaldson" <(E-Mail Removed)> wrote in message
news:0AD7C95C-0781-4027-AB9C-(E-Mail Removed)...
> I would like to be able to force employees to enable macros for a certain
> workbook or it will not let them open the workbook. And maybe put a

password
> on it so if i would like to modify the workbook without the macros

enabled.


 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      5th Dec 2005
Give them a helper workbook that opens the real workbook.

The helper workbook would have a macro that opens the real workbook. If macros
are disabled, then the helper workbook's code won't run--and the real workbook
won't be opened.

The helper workbook would have code that looks like:

Option Explicit
Sub auto_open()
Workbooks.Open Filename:=thisworkbook.path & "\book2.xls", _
Password:="hithere"
ThisWorkbook.Close savechanges:=False
End Sub

Remember to protect that project so that users can't snoop and find the password
to open.

(That said, that kind of protection is pretty weak and can be broken by any user
who is dedicated.)

kcdonaldson wrote:
>
> I would like to be able to force employees to enable macros for a certain
> workbook or it will not let them open the workbook. And maybe put a password
> on it so if i would like to modify the workbook without the macros enabled.


--

Dave Peterson
 
Reply With Quote
 
Hernandez, Roberto
Guest
Posts: n/a
 
      5th Dec 2005
"kcdonaldson" <(E-Mail Removed)> escribió en el mensaje
news:0AD7C95C-0781-4027-AB9C-(E-Mail Removed)...
>I would like to be able to force employees to enable macros for a certain
> workbook or it will not let them open the workbook. And maybe put a
> password
> on it so if i would like to modify the workbook without the macros
> enabled.



Regards!

You can´t do it directly with Excel.
You need to configure book to hide useful sheets when closing, an unhidding
it when a correct password is typed when promt...

For example, when you close your book (in the beforeclose event) you can
hide your sheets with a set of lines like this one:

Worksheets("Usefulsheet").Visible = xlSheetVeryHidden
Worksheets("NonUsefulSheet").Visible = xlSheetVisible

and in the Workbook_Open event something like:

Worksheets("Usefulsheet").Visible = xlSheetVisible
Worksheets("NonUsefulSheet").Visible = xlSheetVeryHidden

So, if user disables macros at startup, will only see a nonuseful sheet,
whit a sentence like: "you disabled macros when opening this book, close it
and able macros when promt..."

It's an easy but not 100% secure method...


 
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
Force users to enable macros on a protected workbook? Lostguy Microsoft Excel Discussion 4 8th Sep 2011 02:48 PM
Force users to enable macros when open a workbook =?Utf-8?B?VGFu?= Microsoft Excel New Users 2 15th Apr 2007 05:09 PM
Force to enable macros =?Utf-8?B?RGVueXM=?= Microsoft Excel Programming 4 6th Jul 2006 02:24 PM
Force Enable Macros pgjoshi Microsoft Excel Programming 3 6th Mar 2004 12:33 PM
Re: Force Enable Macros Ed Microsoft Excel Programming 0 24th Sep 2003 07:59 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:19 PM.