Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ram Ram is offline
external usenet poster
 
Posts: 138
Default Disabling disable macros

Hi,
I wrote macros in my excel sheet. If user clicks on disable macro, my excel
sheet should not be opened. Any help.
Regards,
Ram

  #2   Report Post  
Posted to microsoft.public.excel.programming
ben ben is offline
external usenet poster
 
Posts: 232
Default Disabling disable macros

most usual solution

have one extra sheet that declares loudly "MACROS MUST BE ENABLED FOR THIS
WORKBOOK TO RUN." and your other worksheets hidden. If they click enble
macros use code to have that sheet hidden and all other appear. but if they
click disable only that sheet is visible. Be sure to reverse the process on
save or close.
Ben

--
When you lose your mind, you free your life.


"Ram" wrote:

Hi,
I wrote macros in my excel sheet. If user clicks on disable macro, my excel
sheet should not be opened. Any help.
Regards,
Ram

  #3   Report Post  
Posted to microsoft.public.excel.programming
Ram Ram is offline
external usenet poster
 
Posts: 138
Default Disabling disable macros

Hi Ben,
Thank you very much. But when i make the sheets visible, user can save the
EXCEL and he will have a copy of visible sheets.
Thanks and Regards,
Ram

"ben" wrote:

most usual solution

have one extra sheet that declares loudly "MACROS MUST BE ENABLED FOR THIS
WORKBOOK TO RUN." and your other worksheets hidden. If they click enble
macros use code to have that sheet hidden and all other appear. but if they
click disable only that sheet is visible. Be sure to reverse the process on
save or close.
Ben

--
When you lose your mind, you free your life.


"Ram" wrote:

Hi,
I wrote macros in my excel sheet. If user clicks on disable macro, my excel
sheet should not be opened. Any help.
Regards,
Ram

  #4   Report Post  
Posted to microsoft.public.excel.programming
ben ben is offline
external usenet poster
 
Posts: 232
Default Disabling disable macros

you can add code to the

sub workbook_beforesave(byval cancel as boolean)
'make sheets invisible here again.

end sub

put that in your workbook module


--
When you lose your mind, you free your life.


"Ram" wrote:

Hi Ben,
Thank you very much. But when i make the sheets visible, user can save the
EXCEL and he will have a copy of visible sheets.
Thanks and Regards,
Ram

"ben" wrote:

most usual solution

have one extra sheet that declares loudly "MACROS MUST BE ENABLED FOR THIS
WORKBOOK TO RUN." and your other worksheets hidden. If they click enble
macros use code to have that sheet hidden and all other appear. but if they
click disable only that sheet is visible. Be sure to reverse the process on
save or close.
Ben

--
When you lose your mind, you free your life.


"Ram" wrote:

Hi,
I wrote macros in my excel sheet. If user clicks on disable macro, my excel
sheet should not be opened. Any help.
Regards,
Ram

  #5   Report Post  
Posted to microsoft.public.excel.programming
Ram Ram is offline
external usenet poster
 
Posts: 138
Default Disabling disable macros

Hi Ben,
Thanks . It works.
Regards,
Ram

"ben" wrote:

you can add code to the

sub workbook_beforesave(byval cancel as boolean)
'make sheets invisible here again.

end sub

put that in your workbook module


--
When you lose your mind, you free your life.


"Ram" wrote:

Hi Ben,
Thank you very much. But when i make the sheets visible, user can save the
EXCEL and he will have a copy of visible sheets.
Thanks and Regards,
Ram

"ben" wrote:

most usual solution

have one extra sheet that declares loudly "MACROS MUST BE ENABLED FOR THIS
WORKBOOK TO RUN." and your other worksheets hidden. If they click enble
macros use code to have that sheet hidden and all other appear. but if they
click disable only that sheet is visible. Be sure to reverse the process on
save or close.
Ben

--
When you lose your mind, you free your life.


"Ram" wrote:

Hi,
I wrote macros in my excel sheet. If user clicks on disable macro, my excel
sheet should not be opened. Any help.
Regards,
Ram



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Disabling disable macros

sub workbook_beforesave(byval cancel as boolean)

That code won't compile, because it doesn't match teh BeforeSave
declaration.

Use
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel
As Boolean)

instead.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"ben" (remove this if mailing direct) wrote
in message
...
you can add code to the

sub workbook_beforesave(byval cancel as boolean)
'make sheets invisible here again.

end sub

put that in your workbook module


--
When you lose your mind, you free your life.


"Ram" wrote:

Hi Ben,
Thank you very much. But when i make the sheets visible, user
can save the
EXCEL and he will have a copy of visible sheets.
Thanks and Regards,
Ram

"ben" wrote:

most usual solution

have one extra sheet that declares loudly "MACROS MUST BE
ENABLED FOR THIS
WORKBOOK TO RUN." and your other worksheets hidden. If they
click enble
macros use code to have that sheet hidden and all other
appear. but if they
click disable only that sheet is visible. Be sure to reverse
the process on
save or close.
Ben

--
When you lose your mind, you free your life.


"Ram" wrote:

Hi,
I wrote macros in my excel sheet. If user clicks on
disable macro, my excel
sheet should not be opened. Any help.
Regards,
Ram



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
Disabling macros EllenM Excel Discussion (Misc queries) 1 February 26th 08 04:57 PM
Disabling Macros Greg Excel Programming 2 February 24th 05 05:06 PM
Disabling Macros R. SRIKANTH Excel Programming 4 January 11th 04 03:26 PM
Disabling/Enabling Macros HRobertson Excel Programming 2 October 24th 03 04:07 PM
Disabling the enable/disable dialog box with Digital Signature CST[_2_] Excel Programming 1 September 8th 03 08:31 PM


All times are GMT +1. The time now is 08:34 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"