Excel Macro to password protect
15 pts.
0
Q:
Excel Macro to password protect
I have this spread sheet that I want to be able to protect from distrubution when given to one person. Is there a way of writing in a macro that will ask for a new password that is in a hidden list at the end of say 30 days and if not entered in the program will not be usable? I hope that my question is clear enough for an answer.
Thanks
ASKED: Feb 9 2009  1:58 AM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
23535 pts.
0
A:
 RATE THIS ANSWER
+1
Click to Vote:
  •   1
  •  0
  • AddThis Social Bookmark Button
right-click the Excel LOGO near the file menu, select View Code, paste this in:

Private Sub Workbook_Open()
If GetSetting("open", "open", "Count", 0) * 1 = 30 Then
Msgbox "Expired!"
ThisWorkbook.Close False
End If
SaveSetting "open", "open", "Count", GetSetting("open", "open", "Count", 0) * 1 + 1
End Sub
Last Answered: Feb 9 2009  8:09 PM GMT by Mshen   23535 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Smarbada   15 pts.  |   Feb 10 2009  1:40AM GMT

I understand what this code is doing and how it works but I got it to work once and then I entered it again using the number 3 rather than 30 to test it and now it doesn’t run. Hum maybe something I did. But thanks so much for your time on this.

 

JP2112   475 pts.  |   Feb 11 2009  10:01PM GMT

I can just click “No” to the “Allow Macros” dialog box when opening your workbook. That would stop the macro from running.

 
0