Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Macros Password

Status
Not open for further replies.

n4tl

Programmer
Feb 11, 2006
2
AT
Hi there,

i need to remove the password protection of the macros in about 1000 excel files. I KNOW the password, it just takes too much time to do it by hand. Is there a way to do this automatically?
thanks
 
Is it the same password for all files? Do you have a list of the files? Do you know how to write loops in VBA?

Cheers, Glenn.

Did you hear about the literalist show-jumper? He broke his nose jumping against the clock.
 
Yes, its the same password for all files.
I have a list, and i know how to write loops in VBA.
 
Put the list of files in a sheet. Write a loop to get each cell in the list, and use it's contents to open the file ...
Code:
Application.DisplayAlerts=False
For Each c in Range("MyList")
     Workbooks.Open FileName:=c.Value, Password:="mypwd"
     ActiveWorkbook.SaveAs FileName:=c.Value, Password:=""
     ActiveWorkbook.Close
Next



Cheers, Glenn.

Did you hear about the literalist show-jumper? He broke his nose jumping against the clock.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top