Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Apply passwords to open on multiple files
Scenario: one folder(x) contains 3 files (without a password to open) name
a, b, & c. A separate file(z) contains a list of file names and corresponding passwords for files in folder(x). See below: File Password a 123 b 456 c 789 What I would like is to build a macro that cycles through the files in folder(x), looks up the corresponding password in the password file(z), and applies as open-file passwords to the files in folder(x). Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Apply passwords to open on multiple files
Hi,
It would be simpler to start with the list in file z, instead of folder x 'cycle through rows in file z myworkbook=some_range_from_file_z mypassword=some_range_from_file_z Workbook.Open myworkbook 'don't forget to include full path!!! ActiveWorkbook.Protect Password:=mypassword, Structu=True, Windows:=False 'next cycle If you insist on cycling through the folder, you should use FileScriptingObject, or FSO. Some cool examples can be googled. Regards, ManualMan |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Open multiple files | Setting up and Configuration of Excel | |||
Open multiple files into multiple worksheets of the same workbook | Excel Discussion (Misc queries) | |||
open multiple files | Excel Discussion (Misc queries) | |||
Apply VBA function to multiple excel files | Excel Programming | |||
Apply password to multiple Excel Files? | Excel Programming |