Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default can you make a password active after a certain date?


I dont know if this is at all possible??

I wanted to enable a spreadsheet to be password protected after a
certain timeframe has passed - or on a specified date.

No idea where to start so any help or suggestions would be appreciated
:)


--
RCollinge
------------------------------------------------------------------------
RCollinge's Profile: http://www.excelforum.com/member.php...o&userid=24276
View this thread: http://www.excelforum.com/showthread...hreadid=378922

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default can you make a password active after a certain date?


Good morning RCollinge

This isn't possible using any native Excel commands but we could write
our own using the Before_Save event procedure. The code below will
happily let a workbook save without a password, however, after 1st Jan
next year a password (of "password") will be added - with no warning -
to the file when it is saved. However, there is a big but here. The
user must say "OK" to run macros when the file is opened - if the user
says no to the macro question the code will do nothing. And don't
forget that this code (as it uses event procedures) needs to go into
the ThisWorkbook pane of the VBE.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Application.DisplayAlerts = False
mydate = Now()
mydate2 = DateValue("January 1, 2006")
ActiveWorkbook.Save
If mydate mydate2 Then
ActiveWorkbook.SaveAs Filename:="C:\Book4.xls", Password:="password"
End If
Application.DisplayAlerts = False
End Sub

HTH

DominicB


--
dominicb
------------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932
View this thread: http://www.excelforum.com/showthread...hreadid=378922

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 make identical cell datas active to allow changes caprey New Users to Excel 5 December 21st 08 05:42 PM
VBA: Make Excel the active application Gaetan Excel Discussion (Misc queries) 0 March 19th 07 05:57 PM
How to make only the cells i need active debs1389 Excel Worksheet Functions 3 May 13th 06 07:49 PM
Make this the active workbook Annette[_4_] Excel Programming 2 April 20th 04 03:15 PM
Make a particular cell the active one Newbie Excel Programming 3 April 14th 04 04:52 PM


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