LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default Password Setting

I couldn't agree more - getting down what's in your head just doesn't
happen sometimes - even when you read it back to yourself it looks
ok.... until you've posted it that is... *then* you realise!

;-)

Piranha wrote:
Gareth,
Yeah i didn't express my self very well did i. (You could force the
user to enable macros,
by having the workbook auto close if the macros are not enabled..)
Pretty much common sense huh.

What i was thinking and what i wrote weren't coordinated

I have a few workbooks set up like you describe, they work well.

Thanks for correcting my post, don't want to give bad info.

Dave
Gareth Wrote:

Just expand on this, you can't have the workbook auto close since this
would require the running of macros. What you can do is have the
workbook default to a blank sheet upon opening (maybe with a message
advising to reopen with macros enabled) and all the other sheets
hidden.

I checked our the below link. In addition to the code it proposes, I
would use BeforeSave to hide all the sheets upon saving. Otherwise, if
the user saves but doesn't close the workbook it will not be saved in
the "locked up" state should they crash out of Excel.

With respect to your other query about password dates: no such
functionality exists to my knowledge. There are ways and means around
such a thing though. For example, you could include a check for the
system date in the BeforeSave event of a workbook and remove / add a
password depending on the date.

My preferred option, rather than use event trapping, is to
programmatically open the workbook - maybe from a option form or menu
button loaded by a separate AddIn - often using the user's network
login
to determine their rights. This way you are more in control and it's
often simpler for the user too - but it doesn't lend itself to all
circumstances.

HTH,
Gareth

Piranha wrote:

VBALearner,
You could force the user to enable macros, by having the workbook


auto

close
if the macros are not enabled..

Here is one way.
http://www.vbaexpress.com/kb/getarticle.php?kb_id=578

Dave
VBALearner Wrote:


hi hi, it is so nice to have this forum...

I have a query on VBA programming regarding password setting. How


to

set up a password when opening a file. good to have expiry date!!


I

tried once before to write a macro to lock the file. However, if the
user choose "disable macros", then it does not work! Is there any


way

out?? I know there is a built-in funtion in Excel to protect a file

from reading or writing upon opening. But there is no expiry date

attached!! thank you for yr help!!! :)





 
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
Setting password on worksheet in Excel 2000 Bill[_2_] Excel Worksheet Functions 1 February 14th 07 07:05 PM
Setting VBA Project Password Howard Kaikow Excel Programming 4 May 18th 05 03:28 PM
Setting an Open-file password Terry Excel Programming 3 April 6th 05 01:24 AM
Setting Password & WriteResPassword Kevin H. Stecyk[_2_] Excel Programming 0 January 27th 05 02:16 AM
Setting worksheet protection password in VBA Mark Bochner Excel Programming 0 October 6th 03 10:59 PM


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

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"