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. |
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 |
All times are GMT +1. The time now is 08:46 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com