Shortcut that passes a password

M

M.Siler

I have a spreadsheet that is on our network and I keep it password protected
to keep the general staff out, but it's not overly sensitivity. Is there a
way that I can put a shortcut on my system what will pass in the password so
when I'm on my computer I don't have to enter the password everytime? I'm
using Excel 2007.

Thanks,
Mark
 
D

Dave Peterson

You could create another workbook that opens your real workbook and then closes
itself. The put a shortcut to that helper workbook on your desktop.

That first workbook could have the password built into it.

Option Explicit
Sub auto_open()

Dim myPWD As String
Dim wkbk As Workbook
myPWD = "hi"
Set wkbk = Workbooks.Open(Filename:="C:\my documents\excel\book1.xls", _
Password:=myPWD)

wkbk.RunAutoMacros which:=xlAutoOpen

'ThisWorkbook.Close savechanges:=False

End Sub

When you're done testing, uncomment that last line. It closes the helper
workbook without saving--could be a pain while you're testing.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
 
Top