[Fixed!] Method Open of Object Workbooks Failed (4 Solutions)

“Method open of object workbooks failed” occurs during run-time when code is executed. It is a common error that occurs during run-time. If you are looking for some special tricks to solve the problem of “method open of object workbooks failed” you’ve come to the right place. In Microsoft Excel, there are numerous ways to fix this problem. This article will discuss four methods to resolve the problem. Let’s follow the complete guide to learn all of this.


Download Practice Workbook

Download this practice workbook to exercise while you are reading this article. It contains all the datasets and methods in different spreadsheets for a clear understanding.


4 Possible Solutions for “Method Open of Object Workbooks Failed” Error

In the following section, we will use four effective and tricky solutions to solve the problem of “method open of object workbooks failed”. We will use the VBA code to solve the problem in the first and second solutions. Thirdly, we show how to fix corrupted files, and finally, we demonstrate that MS Excel should not be run in Net.App applications. This section provides extensive details on these solutions. You should learn and apply these to improve your thinking capability and Excel knowledge. We use the Microsoft Office 365 version here, but you can utilize any other version according to your preference.


Solution 1: Use GetOpenFilename Method

If you want to solve the problem of “method open of object workbooks failed”, you need to use the help of VBA. Microsoft Visual Basic for Applications (VBA) is Microsoft’s Event Driven Programming Language. To use this feature you first need to have the Developer tab showing on your ribbon. Click here to see how you can show the Developer tab on your ribbon. Once you have that, follow these detailed steps to solve the problem of “method open of object workbooks failed”,

📌 Steps:

  • VBA has its own separate window to work with. You have to insert the code in this window too. To open the VBA window, go to the Developer tab on your ribbon. Then, select Visual Basic from the Code group.

using VBA code to solve “Method Open of Object Workbooks Failed” Error

  • VBA modules hold the code in the Visual Basic Editor. It has a .bcf file extension. We can create or edit one easily through the VBA editor window. To insert a module for the code, go to the Insert tab on the VBA editor. Then click on Module from the drop-down.

inserting module

  • As a result, a new module will be created.
  • Now, select the module if it isn’t already selected. Then write down the following code in it.
Sub Opening_Workbook ()
    Dim strrFile As String
    strrFile = Application.GetOpenFilename()
    Workbooks.Open (strrFile)
End Sub
  • Next, save the code.
  • Lastly, you have to click on Run to run the macro.

  • Consequently, you will see that an Open window will appear.
  • Here, you have to choose the workbook which you want to open.
  • Next, click on OK.

This is how you will be able to open the Excel workbook and solve the problem.

Read More: How to Open Workbook and Run Macro Using VBA (4 Examples)


Solution 2: Apply Correct File Path While Opening Workbook

Now, we will show another VBA code to solve the problem. If you want to solve the problem of “method open of object workbooks failed”, you need to use the help of following VBA code. You have to follow these detailed steps to solve the problem of “method open of object workbooks failed”.

📌 Steps:

  • VBA has its own separate window to work with. You have to insert the code in this window too. To open the VBA window, go to the Developer tab on your ribbon. Then, select Visual Basic from the Code group.

apply VBA code to solve “Method Open of Object Workbooks Failed” Error

  • VBA modules hold the code in the Visual Basic Editor. It has a .bcf file extension. We can create or edit one easily through the VBA editor window. To insert a module for the code, go to the Insert tab on the VBA editor. Then click on Module from the drop-down.

  • As a result, a new module will be created.
  • Now select, the module if it isn’t already selected. Then write down the following code in it.
 Sub Macro_2()
   Workbooks.Open Filename:="C:\Users\USER\Desktop\saquib\61-0081\How to Forecast Cash Flow in Excel.xlsx"
End Sub
  • Next, save the code.
  • Therefore, you have to click on Run to run the macro.

run VBA code

This is how you will be able to open the Excel workbook and solve the problem.

Note:

Sometimes, when the above code is not working to solve the problem, the Approve-It add-in may be the main issue in some cases. On the computer, you have to disable it, and then the procedure should work perfectly.

In some cases, the Foxit reader add-in was causing the problem. After removing it, everything worked as it should.

Read More: How to Open Workbook as Read-Only with Excel VBA


Solution 3: Make Sure File Is Not Corrupted

Occasionally, a corrupted file will cause the error “method open of object workbooks failed” when opening a file in read-only mode. As a result, Excel would give an error since it can only fix corrupt files by writing to them, and repair files only if they are allowed to be opened. A corrupt file cannot be repaired in read-only mode, so if you open it in this mode, it will not be able to be opened. A corruption occurred because the sources for the dropdown list on another spreadsheet were not copied. To solve this problem, it is necessary to open the input file manually and resave it and you must change the function name since it was corrupted.

Read More: How to Open Folder and Select File Using Excel VBA (4 Examples)


Solution 4: Avoid Running Excel on Net.App Application

Sometimes, this problem may occur because of MS Excel running on the Net.App application where VBA wasn’t installed accurately. So you have to go to Control Panel and select Program and Features and uninstall this program. Next, you have to find out your installed office, then you have to right-click and choose Change. Microsoft Visual Basic for Applications (VBA) is Microsoft’s Event Driven Programming Language. To use this feature you first need to have the Developer tab showing on your ribbon. Click here to see how you can show the Developer tab on your ribbon.

Read More: How to Open Workbook from Path Using Excel VBA (4 Examples)


Conclusion

That’s the end of today’s session. I strongly believe that from now, you may solve the problem of “method open of object workbooks failed”. If you have any queries or recommendations, please share them in the comments section below.

Don’t forget to check our website Exceldemy.com for various Excel-related problems and solutions. Keep learning new methods and keep growing!


Related Articles

Saquib

Saquib

Welcome to my Profile. I am working on and researching Microsoft Excel right now, and I will be posting articles about it here. I received a B.Sc. in Naval Architecture and Marine Engineering from the Bangladesh University of Engineering and Technology (BUET). Having studied naval architecture, I have a strong interest in research and development. Always try to learn from different sources and come up with creative solutions.

We will be happy to hear your thoughts

Leave a reply

ExcelDemy
Logo