Password Question

  • Thread starter Thread starter Patrick Simonds
  • Start date Start date
P

Patrick Simonds

I have a workbook which I have created as a template, which is password
protected.

Each week I want to be able to open that template file from within another
workbook, but can not figure out how to have the VBA enter the password and
then select read only. After the file is open I have some VBA code which
will save it to a set directory with a title based on the date.
 
Patrick Simonds...
I have a workbook which I have created as a template, which is password
protected.

Each week I want to be able to open that template file from within another
workbook, but can not figure out how to have the VBA enter the password
and then select read only. After the file is open I have some VBA code
which will save it to a set directory with a title based on the date.


Workbooks.Open Filename:=ThisWorkbook.Path & "\MyBook.xls",
Password:="TopSecret1", ReadOnly:=True

This assumes that the files are stored in the same directory.

HTH

Regards,
Kevin
 
Patrick,

Can you substitute the new directory in place of
Filename:=ThisWorkbook.Path?

Kevin


Patrick wrote,
 
Yes

New code looks like this:

Workbooks.Open Filename:="C:\Documents and Settings\Patrick\Desktop\Backup
Board Assignments Template.xls", Password:="snapple", ReadOnly:=True
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top