Excel remove password multiple files on network

Anonymous
2016-06-28T18:04:50+00:00

I need to remove the workbook open password (which is the same) to multiple files on our network.  I found a code dated back in 2014 by Graham Mayor; however, I am unable to hide or set automatic update all links.  I tried many UpdateLink= or := options to no prevail.

Please help

Thanks 

Here is the code G. Mayor posted

Sub RemovePasswords()

Dim xlBook As Workbook

Dim strFilename As String

Const fPath As String = "C:\Path"        'The folder to process, must end with ""

Const strPassword As String = "openpassword"        'case sensitive

Const strEditPassword As String = "editpassword" 'If no password use ""

    strFilename = Dir$(fPath & "*.xls") 'will open xls & xlsx etc

    While Len(strFilename) <> 0

        Application.DisplayAlerts = False

        Set xlBook = Workbooks.Open(Filename:=fPath & strFilename, _

                                    Password:=strPassword, _

                                    WriteResPassword:=strEditPassword)

        xlBook.SaveAs Filename:=fPath & strFilename, _

                      Password:="", _

                      WriteResPassword:="", _

                      CreateBackup:=True

        xlBook.Close 0

        Application.DisplayAlerts = True

        strFilename = Dir$()

    Wend

End Sub

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

2 answers

Sort by: Oldest
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. Anonymous
    2016-06-29T14:21:05+00:00

    Hello,

    Glad to know that your issue/query about removing password from multiple Excel files on network is resolved. I am sure your resolution will help others facing similar issues.

    Thank you.

    Was this answer helpful?

    0 comments No comments