Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Closing a Workbook if Macros aren't enabled.

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 791
Default Closing a Workbook if Macros aren't enabled.

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


" 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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 256
Default Closing a Workbook if Macros aren't enabled.

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 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



" 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 -



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Closing a Workbook if Macros aren't enabled.

On Aug 6, 4:06 pm, ilia 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 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


" 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
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 to track changes in a workbook with macros enabled Jerjuice Excel Discussion (Misc queries) 0 October 11th 06 06:16 PM
how to track changes in a workbook with macros enabled Jerjuice Excel Discussion (Misc queries) 0 October 11th 06 06:15 PM
choose default macros Not Enabled / Macros Enable Setting BEEJAY Excel Programming 2 June 30th 06 01:07 PM
Close Workbook if Macros not enabled Graham Fowler Excel Programming 2 September 23rd 05 11:06 PM
Open workbook-macros enabled, opening another with macros George J Excel Programming 5 September 17th 04 02:07 PM


All times are GMT +1. The time now is 02:28 AM.

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

About Us

"It's about Microsoft Excel"