15 pts.
 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

Software/Hardware used:
ASKED: February 9, 2009  1:58 AM
UPDATED: July 31, 2011  3:13 PM

Answer Wiki:
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 Wiki Answer Submitted:  February 9, 2009  8:09 pm  by  mshen   27,310 pts.
All Answer Wiki Contributors:  mshen   27,310 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

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.

 15 pts.

 

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

 475 pts.