Look up password to be used to protect workbook

Caver Dom

New Member
Joined
May 26, 2011
Messages
1
I wonder if anyone can assist in the following question:<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<o:p> </o:p>
I would like to know how to look up a password to be used to protect a workbook within a macro.<o:p></o:p>
<o:p> </o:p>
I would like to run a macro that amongst other things protects a workbook with a password so that users can only access the workbook with a known password (i.e. on tools-options-security tab you type in a password to open). This would be easy enough but there’s the snitch – the password to be used is stated in another workbook.<o:p></o:p>
<o:p> </o:p>
The reason for this is the macro loops around creating the same spreadsheet but saved each time with a different name and different password. Rather than me typing the many different passwords into the macro editor I was hoping I could do some kind of lookup cell reference.<o:p></o:p>
<o:p> </o:p>
My only thoughts so far are to save the password to some kind of reference that is then referenced when the password is required within the macro. It would then do its thing and then jump to the next loop with new name and new referenced password.<o:p></o:p>
<o:p> </o:p>
Any thoughts? :confused:
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Forum statistics

Threads
1,224,605
Messages
6,179,860
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top