Dim bk as Workbook, sPath as String
Dim sStr as String
sPath = "C:\MyFolder\"
sStr = Dir(sPath & "*.xls")
do while sStr < ""
set bk = workbooks.Open( filename:=sStr, _
password:="ABCD")
Application.DisplayAlerts = True
bk.SaveAs bk.FullName
Application.DisplayAlerts = False
bk.close Savechanges:=False
sStr = Dir()
Loop
--
Regards,
Tom Ogilvy
"guilhaume " wrote in message
...
Thx a lot, but I think I didn't explain very well what I wanted to do
:)
It is to say:
have a script that takes out the workbook's protection without having
to open the excel file with Office and do 'Utils', 'Protection',
'Unprotect the workbook' (problably the menu names are wrong, as I am
french I tested a translation... ;))
in fact I wanted a script like that:
for all the files f in the directory d do
f.unprotectWorkbook()
end
reguards
---
Message posted from http://www.ExcelForum.com/