Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Hide sheets before macros can run

My project is to secure an excel workbook for distribution to remote
agencies.
I have worked out a code for date checking, and how to close excel if
dates are reached.

I could say the project is finished at this stage, having reached my
objective but like others I can't in good conscience regard this as
'finished'. Purely because there are countless other security holes
which could be patched with macros if I could ject figure them out.

many ppl talk about forcing macros. I know now they can't literally be
forced, but we can persuade the user to use them.

Can someone please explain to me through the use of code, how to set a
dummy sheet (which I will have a message on, telling ppl to use
macros) while other sheets are hidden? And all this BEFORE macros are
given the chance to run??

Code for individually hiding sheets is relatively easy, but these are
macros. How are sheets hidden before macros are run?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 618
Default Hide sheets before macros can run

Hi Rich

distribute the workbook with the sheets hidden and place before close code
to ensure that the sheets are are hidden again if the person enables macros,
opens the workbook and then closes it.

Cheers
JulieD

"Rich" wrote in message
om...
My project is to secure an excel workbook for distribution to remote
agencies.
I have worked out a code for date checking, and how to close excel if
dates are reached.

I could say the project is finished at this stage, having reached my
objective but like others I can't in good conscience regard this as
'finished'. Purely because there are countless other security holes
which could be patched with macros if I could ject figure them out.

many ppl talk about forcing macros. I know now they can't literally be
forced, but we can persuade the user to use them.

Can someone please explain to me through the use of code, how to set a
dummy sheet (which I will have a message on, telling ppl to use
macros) while other sheets are hidden? And all this BEFORE macros are
given the chance to run??

Code for individually hiding sheets is relatively easy, but these are
macros. How are sheets hidden before macros are run?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Hide sheets before macros can run

Hi
not tested but as a starting point.
1. Create your 'dummy sheet'

2.Put the following code in your workbook module (not in a standard module):
sub workbook_open()
dim wks as worksheet
application.screenupdating=false
with me
..unprotect password:="your_password"
for each wks in .worksheets
if lcase(wks.name)<"dummy" then
..visible=true
end if
next wks
..worksheets("dummy").visible=xlsheetveryhidden
end with
application.screenupdating=true
end sub

sub workbook_beforeclose()
dim wks as worksheet
application.screenupdating=false
with me
..worksheets("dummy").visible=true
for each wks in .worksheets
if lcase(wks.name)<"dummy" then
..visible=xlsheetveryhidden
end if
next wks
..protect password:="your_password"
..save
end with
application.screenupdating=true
end sub




"Rich" wrote:

My project is to secure an excel workbook for distribution to remote
agencies.
I have worked out a code for date checking, and how to close excel if
dates are reached.

I could say the project is finished at this stage, having reached my
objective but like others I can't in good conscience regard this as
'finished'. Purely because there are countless other security holes
which could be patched with macros if I could ject figure them out.

many ppl talk about forcing macros. I know now they can't literally be
forced, but we can persuade the user to use them.

Can someone please explain to me through the use of code, how to set a
dummy sheet (which I will have a message on, telling ppl to use
macros) while other sheets are hidden? And all this BEFORE macros are
given the chance to run??

Code for individually hiding sheets is relatively easy, but these are
macros. How are sheets hidden before macros are run?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Hide sheets before macros can run

do a search of this newsgroup in Google groups. There are plenty of
approaches to this.

http://groups.google.com/groups?as_q...ng&lr=&hl=e n


or
http://groups.google.com/advanced_group_search?hl=en

search for force macro enable
group microsoft.public.excel.programming

--
Regards,
Tom Ogilvy

"Rich" wrote in message
om...
My project is to secure an excel workbook for distribution to remote
agencies.
I have worked out a code for date checking, and how to close excel if
dates are reached.

I could say the project is finished at this stage, having reached my
objective but like others I can't in good conscience regard this as
'finished'. Purely because there are countless other security holes
which could be patched with macros if I could ject figure them out.

many ppl talk about forcing macros. I know now they can't literally be
forced, but we can persuade the user to use them.

Can someone please explain to me through the use of code, how to set a
dummy sheet (which I will have a message on, telling ppl to use
macros) while other sheets are hidden? And all this BEFORE macros are
given the chance to run??

Code for individually hiding sheets is relatively easy, but these are
macros. How are sheets hidden before macros are run?



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 hide a macros/functions from excel sheets Bepenfriends Excel Discussion (Misc queries) 1 December 5th 06 06:50 PM
Macros - Unhide and hide minka Excel Discussion (Misc queries) 2 October 22nd 06 12:25 AM
Hide macros executions Angeliki Excel Programming 1 November 26th 03 07:46 AM
How can you hide the macros ? Josee Lapointe Excel Programming 1 November 17th 03 05:47 PM
Hide Macros from Users Larry Graff Excel Programming 2 September 10th 03 05:41 PM


All times are GMT +1. The time now is 12:38 PM.

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

About Us

"It's about Microsoft Excel"