1

I have multiple excel workbook send to me everyday with password protected. Our procedure requires me to remove the password and save it in share drive. I believe the password is added by the sender using below

workbook.saveas password:="pw"

i have tried workbook.unprotect or workbook.saveas password:="" but this fail to remove the password. anyone know how i can automate this instead of manually removing the password?

0

1 Answer 1

1

You can change the password setting in the workbook before saving.

Option Explicit

Sub testPasswordRemoval()

    Dim wb As Workbook

    Set wb = Workbooks.Open(Filename:="C:\Temp\Book2.xlsm", Password:="pw")
    wb.Password = ""
    wb.SaveAs "C:\Temp\NewBook.xlsm"

End Sub
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.