Engineer Joe
Well-known Member
- Joined
- Jun 10, 2005
- Messages
- 549
Either my google-foo skillz are waning or google itself just isn't useful in finding the distinction in my inquiry, so here I am. Long time, no see Mr. Excel. Let me preface my question with this. When you go into in the VBA project for an Excel file and click on the Tools Dropdown and select "VBAProject - Properties," you get a pop-up window and then select the "Protection" tab, you can lock the project with a password. I need to do this via VBA. So that's my question. How do I accomplish this via VBA. I need to do this via VBA because I've got a ton of worksheet-specific XLSM files. I got some code several years ago that I employ regularly that lets me open a bunch of files in a subfolder and execute whatever macro I want on those files. So, basically, I want to run this on my entire file folder structure for all XLSM files. So the code I need is firstly the code to lock all the files...then I need another bit of code to unlock the files automatically that I would conceivably insert into my personal addin that just unlocks the files when I open them. Can anyone help me figure that out? Yes, a little bit inception-esque here, so I figure it'll be kind of fun for whoever knows how to do it. Alrighty, I'm eagerly awaiting a reply from a true Excel master whom I'll worship endlessly and create a little shrine to if you can help me out here.
THANKS!
THANKS!