I have several Excel files: some that were created with a password and some without a password. The ones that don't have a password are able to be opened in Excel 2010 and newer. But, the ones with a password are not displaying the window to enter that password.

How do I fix this issue?


VBA Solution:

Create this Sub routine in Password free Excel file and Run it. This code will open the Password protected file and read the Password. So write the same Password with Set Wbk2 line.

Sub WorkbookOpen()

Application.ScreenUpdating = False

Dim wbk1 As Workbook
Dim wbk2 As Workbook

Set wbk1 = ThisWorkbook
Set wbk2 = Workbooks.Open(Filename:="Your Path", Password:="your Password")

Set wbk1 = Nothing
Set wbk2 = Nothing

MsgBox "Logged the File."

Application.ScreenUpdating = True

End Sub

Non VBA Solution:

Sometimes due to the Installed Add-Ins this problem arises. To get rid from that, I would like to suggest to do the followings.

  • Click File then Options.
  • Hit Trust Center, Trust Center Settings, Add-ins.
  • Check the last one, Disable all Add-Ins.
  • Close Excel, Restart Computer and open the file.

NB: After you open the file, enable all the Add Ins.

Other is,

  • File, Option.
  • Trust Center, Trust Center Settings, Trusted Locations.
  • Confirm if you are saving your file to a trusted location.
  • Close Excel, Restart Computer and open the file.
  • Why wbk2.save after you've set it to Nothing? – tomdemuyt Mar 9 '18 at 9:36
  • @tomdemuyt, thanks for prompting me,, now edited, did you try this code? – Rajesh S Mar 9 '18 at 9:45
  • That'll work, thx – tomdemuyt Mar 9 '18 at 10:24
  • Glad to hear from you, your apparition encourage me lot. Now if you feel just vote the answer. – Rajesh S Mar 10 '18 at 4:09
  • 1
    Rajesh, we certainly appreciate all of the time and effort you have dedicated to the Super User community. Your energy and proactive attitude are admirable! However, I wanted to pass along a friendly piece of advice. I know that you have the best of intentions, but the vast majority of your proposed edits still contain several spelling, grammar, and format errors. That's why we reject so many of them. It may be wise to consider focusing your attention on other ways to contribute, such as your great questions and answers. Just something to think about. Thanks for your help! – Run5k Mar 10 '18 at 5:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.