I have the below macro which opens a file from a directory and removes it's password and then saves it
back on the same directory. Now I have excel workbook where I have a list of files in column A and there Passwords in Column
B and Action to be taken in Column C .i.e. Remove Password. I want to the below macro to loop through the list of the files
in Column A and open the workbooks and remove the passwords of those workbooks where in Column C against it is mentioned to
Application.DisplayAlerts = False
'Dim X as Range
'For Each Cell in X
Workbooks.Open Filename:= _
ActiveWorkbook.SaveAs Filename:= _
FileFormat:=xlNormal, Password:="", writerespassword:="", _
Windows("Run Macro for Multiple workbooks.xls").Activate
Application.DisplayAlerts = True
And Below is the code which I have which can run the macro on all files present in a directory
Dim F As String
Dim roww As Long
roww = 0
Dim FileLocSpec As String
FileLocSpec = "C:Temp*.xls"
F = Dir(FileLocSpec)
Do Until F = ""
roww = roww + 1
Cells(roww, 1).Value = F
F = Dir
Set r = Range("A1")
While r.Value <> ""
Workbooks.Open Filename:="C:Temp" & r.Value
Set r = r.Offset(1, 0)
Please find the attached macro file.
Thanks a lot for your help in advance.