PC Review


Reply
Thread Tools Rate Thread

Closing a Workbook if Macros aren't enabled.

 
 
SlyMaelstrom@gmail.com
Guest
Posts: n/a
 
      6th Aug 2007
Basically, I want to make my workbook such that either you enable the
macros or it closes the workbook. That means when the prompt comes up
regarding macros, if you choose to disable them it will close the
workbook. Obviously, this can't be done with a macro because the user
has disabled them... so does anyone know a way? The reasoning for this
is that my macros are designed to ensure the user fills in certain
fields and they do it correctly. I'm doing this with macros as I don't
believe Excel offers a method of requiring a cell to be filled in
without them. Any help with this would be great.

-- Bill

 
Reply With Quote
 
 
 
 
=?Utf-8?B?TWljaGFlbA==?=
Guest
Posts: n/a
 
      6th Aug 2007
Set up a dialogbox or small form confirming the desire of the user to enable
macros, when your macro really is doing is exiting/closing the workbook if
the user clicks on No or if the user clicks on cancel. You set this tricky
little form on Open and it should provide you with the same results as if you
were enabling macros.
Regards,

Michael Arch.
Please click on yes or no if the positng was helpful


"(E-Mail Removed)" wrote:

> Basically, I want to make my workbook such that either you enable the
> macros or it closes the workbook. That means when the prompt comes up
> regarding macros, if you choose to disable them it will close the
> workbook. Obviously, this can't be done with a macro because the user
> has disabled them... so does anyone know a way? The reasoning for this
> is that my macros are designed to ensure the user fills in certain
> fields and they do it correctly. I'm doing this with macros as I don't
> believe Excel offers a method of requiring a cell to be filled in
> without them. Any help with this would be great.
>
> -- Bill
>
>

 
Reply With Quote
 
ilia
Guest
Posts: n/a
 
      6th Aug 2007
Here's what I've seen done before.

Set up a worksheet that explains to the user that macros need to be
enabled, and how to enable them. Make all other sheets xlVeryHidden.
Password your VBA project so that users cannot change this property.
They won't be able to do it from the Immediate window either, if
macros are disabled.

In your Workbook_Open code, call a procedure to unhide the data entry
sheets, and hide the "enable your macros" sheet. This will only occur
if macros are enabled. Likewise, insert code to re-hide them in your
Workbook_Close event.

This way, while the workbook won't close by itself with macros
disabled, it will not allow the user to perform data entry either.
Instead, it will instruct the user to close and reopen the workbook,
and enable macros. If the user screws it up again, this process
repeats.

If the user does enable macros, the Workbook_Open code will setup the
workbook for proper data entry, with all your macros operating as
intended.

Hope this helps your situation.



On Aug 6, 3:00 pm, Michael <Mich...@discussions.microsoft.com> wrote:
> Set up a dialogbox or small form confirming the desire of the user to enable
> macros, when your macro really is doing is exiting/closing the workbook if
> the user clicks on No or if the user clicks on cancel. You set this tricky
> little form on Open and it should provide you with the same results as if you
> were enabling macros.
> Regards,
>
> Michael Arch.
> Please click on yes or no if the positng was helpful
>
>
>
> "SlyMaelst...@gmail.com" wrote:
> > Basically, I want to make my workbook such that either you enable the
> > macros or it closes the workbook. That means when the prompt comes up
> > regarding macros, if you choose to disable them it will close the
> > workbook. Obviously, this can't be done with a macro because the user
> > has disabled them... so does anyone know a way? The reasoning for this
> > is that my macros are designed to ensure the user fills in certain
> > fields and they do it correctly. I'm doing this with macros as I don't
> > believe Excel offers a method of requiring a cell to be filled in
> > without them. Any help with this would be great.

>
> > -- Bill- Hide quoted text -

>
> - Show quoted text -



 
Reply With Quote
 
SlyMaelstrom@gmail.com
Guest
Posts: n/a
 
      9th Aug 2007
On Aug 6, 4:06 pm, ilia <iasaf...@gmail.com> wrote:
> Here's what I've seen done before.
>
> Set up a worksheet that explains to the user that macros need to be
> enabled, and how to enable them. Make all other sheets xlVeryHidden.
> Password your VBA project so that users cannot change this property.
> They won't be able to do it from the Immediate window either, if
> macros are disabled.
>
> In your Workbook_Open code, call a procedure to unhide the data entry
> sheets, and hide the "enable your macros" sheet. This will only occur
> if macros are enabled. Likewise, insert code to re-hide them in your
> Workbook_Close event.
>
> This way, while the workbook won't close by itself with macros
> disabled, it will not allow the user to perform data entry either.
> Instead, it will instruct the user to close and reopen the workbook,
> and enable macros. If the user screws it up again, this process
> repeats.
>
> If the user does enable macros, the Workbook_Open code will setup the
> workbook for proper data entry, with all your macros operating as
> intended.
>
> Hope this helps your situation.
>
> On Aug 6, 3:00 pm, Michael <Mich...@discussions.microsoft.com> wrote:
>
>
>
> > Set up a dialogbox or small form confirming the desire of the user to enable
> > macros, when your macro really is doing is exiting/closing the workbook if
> > the user clicks on No or if the user clicks on cancel. You set this tricky
> > little form on Open and it should provide you with the same results as if you
> > were enabling macros.
> > Regards,

>
> > Michael Arch.
> > Please click on yes or no if the positng was helpful

>
> > "SlyMaelst...@gmail.com" wrote:
> > > Basically, I want to make my workbook such that either you enable the
> > > macros or it closes the workbook. That means when the prompt comes up
> > > regarding macros, if you choose to disable them it will close the
> > > workbook. Obviously, this can't be done with a macro because the user
> > > has disabled them... so does anyone know a way? The reasoning for this
> > > is that my macros are designed to ensure the user fills in certain
> > > fields and they do it correctly. I'm doing this with macros as I don't
> > > believe Excel offers a method of requiring a cell to be filled in
> > > without them. Any help with this would be great.

>
> > > -- Bill- Hide quoted text -

>
> > - Show quoted text -- Hide quoted text -

>
> - Show quoted text -


That's smart. I'll do that.

Michael, I don't get your post... how could I get to what you're
saying if Macros are disabled?

 
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
how to track changes in a workbook with macros enabled =?Utf-8?B?SmVyanVpY2U=?= Microsoft Excel Misc 0 11th Oct 2006 06:16 PM
how to track changes in a workbook with macros enabled =?Utf-8?B?SmVyanVpY2U=?= Microsoft Excel Misc 0 11th Oct 2006 06:15 PM
Close Workbook if Macros not enabled Graham Fowler Microsoft Excel Programming 2 23rd Sep 2005 11:06 PM
Open workbook-macros enabled, opening another with macros George J Microsoft Excel Programming 5 17th Sep 2004 02:07 PM
Why aren't macros enabled? =?Utf-8?B?TG9yaQ==?= Microsoft Excel Misc 1 18th Feb 2004 01:59 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:50 AM.