Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 144
Default Force "Enable" Macros on Userform

I have a Userform that I would like to have users force to "enable macros".
Do not want to give them an option to "disable macros". Can this be done?
If so how? Thank you very much.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Force "Enable" Macros on Userform

no. enabling macros is a security issue. yo cannot use code to override this.
If you could m then spammers and malware would be able to. that would be a
BAD thing.

Also, if code is not enabled, you wouldn't be able to launch the th
userform. and if its disabled, what happens to the code that running to
generate the userform?

"TotallyConfused" wrote:

I have a Userform that I would like to have users force to "enable macros".
Do not want to give them an option to "disable macros". Can this be done?
If so how? Thank you very much.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 523
Default Force "Enable" Macros on Userform

Nope.

All you can really do is make the relevant sheets etc very invisible, lock
your VB project and have code to unhide the sheets. This way if the user
enables macros they'll see they're fine, if they don't then they can't use
your workbook.

Sam


"TotallyConfused" wrote:

I have a Userform that I would like to have users force to "enable macros".
Do not want to give them an option to "disable macros". Can this be done?
If so how? Thank you very much.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 144
Default Force "Enable" Macros on Userform

Thank you for your responses. For the part users will not want to mess with
the form. However, there is alway a wise guy. Just want to be able to
protect form and wise guys from changing any code. How do I lock up my VB
project? My worksheets are already hidden but not with code. How do I do
that? Thank you all for your help. Very much appreciated.

"Sam Wilson" wrote:

Nope.

All you can really do is make the relevant sheets etc very invisible, lock
your VB project and have code to unhide the sheets. This way if the user
enables macros they'll see they're fine, if they don't then they can't use
your workbook.

Sam


"TotallyConfused" wrote:

I have a Userform that I would like to have users force to "enable macros".
Do not want to give them an option to "disable macros". Can this be done?
If so how? Thank you very much.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 523
Default Force "Enable" Macros on Userform

In the VB window, highlight the relevant sheet in the project explorer, and
in the properties window set "Visible" to "-2 - xlSheetVeryHidden"

Once you've done this, right click your project and go to
VBAProjectProperties, and protection and tick "Lock project for viewing" -
put a password in but definitely don't forget it - if you do then it's
virtually impossible to recover.

You then need to create a workbook open event which does something along the
lines of

dim ws as worksheet
for each ws in worksheets
ws.visible = xlsheetvisible
next ws

and a workbook before close event:

dim ws as worksheet
for each ws in worksheets
ws.visible = xlsheetveryhidden
next ws


"TotallyConfused" wrote:

Thank you for your responses. For the part users will not want to mess with
the form. However, there is alway a wise guy. Just want to be able to
protect form and wise guys from changing any code. How do I lock up my VB
project? My worksheets are already hidden but not with code. How do I do
that? Thank you all for your help. Very much appreciated.

"Sam Wilson" wrote:

Nope.

All you can really do is make the relevant sheets etc very invisible, lock
your VB project and have code to unhide the sheets. This way if the user
enables macros they'll see they're fine, if they don't then they can't use
your workbook.

Sam


"TotallyConfused" wrote:

I have a Userform that I would like to have users force to "enable macros".
Do not want to give them an option to "disable macros". Can this be done?
If so how? Thank you very much.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Force "Enable" Macros on Userform

Inside the VBE.
select your workbook's project
tools|vbaproject properties|protection tab

Save, close and reopen your workbook to see how it works.

TotallyConfused wrote:

Thank you for your responses. For the part users will not want to mess with
the form. However, there is alway a wise guy. Just want to be able to
protect form and wise guys from changing any code. How do I lock up my VB
project? My worksheets are already hidden but not with code. How do I do
that? Thank you all for your help. Very much appreciated.

"Sam Wilson" wrote:

Nope.

All you can really do is make the relevant sheets etc very invisible, lock
your VB project and have code to unhide the sheets. This way if the user
enables macros they'll see they're fine, if they don't then they can't use
your workbook.

Sam


"TotallyConfused" wrote:

I have a Userform that I would like to have users force to "enable macros".
Do not want to give them an option to "disable macros". Can this be done?
If so how? Thank you very much.


--

Dave Peterson
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
Enable macros - security settings are at "enable all macros" Vie Excel Programming 1 September 29th 08 03:17 PM
Computer freezes when user clicks "enable" macros Brad Excel Programming 3 April 23rd 08 07:33 PM
"openinf file..."ENABLE MACROS...DISABLE MACROS" F. Lawrence Kulchar Excel Discussion (Misc queries) 3 September 12th 06 10:33 AM
"Enable, Disable macros" window does not pop up, security is medi Miguel Montes[_2_] Excel Programming 1 July 27th 06 02:01 PM
Code to ignore on-screen message concerning "Enable Macros." Phil Hageman[_3_] Excel Programming 2 February 26th 04 01:51 PM


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

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"