View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
John Wilson John Wilson is offline
external usenet poster
 
Posts: 550
Default Enable/Disable Macros

Joseph,

Can anyone tell me if there is any way to bypass the
dialog box that requests whether we want to "Enable
Macros" or "Disable Macros",

There isn't. If there were, what use would there be to
have a dialog box in the first place.

You've already done some work with the login id's and
passwords, so your familiar with writing VBA code.
What you need to do is make the workbook unusable
if macros are disabled. One way to do this would be
to make all sheets except one very hidden when the user saves
the workbook. On that sheet should be a warning that
macros need to be enabled for the workbook to function.

Search Google for "Force Macros" and you'll come up with
a lot of threads and code to do this.

John

"Joseph" wrote in message
...
Can anyone tell me if there is any way to bypass the
dialog box that requests whether we want to "Enable
Macros" or "Disable Macros", everytime an excel file with
a macro is opened and force the macro to be executed ...

The reason I want this is, Ive written a macro such that
whenever a user opens a file, the macro would ask for a
login Id and a password. If the user enters both these
correctly, he/she would be able to access the data stored
in the file, else the file would close. There is also
another file which contains the list of valid login Ids
and their corresponding passwords from which we validate
the Id and password that the user enters.

Now if the user chooses "Disable Macros", the whole
concept of login ID and password would not work.

Unfortunately the simple idea of protecting the file with
a password is not feasible as the fundamental requirement
is that different users must be able to login using their
own passwords ...

Pls help !!!!