Excel VBA runtime error 1004:method ‘’ of object ‘workbooks’ failed

Turk182

Board Regular
Joined
Sep 9, 2009
Messages
68
Office Version
  1. 365
Platform
  1. MacOS
Hi, does anyone have an idea regarding a possible “fix” for this error?
--Excel VBA runtime error 1004: method ‘’ of object ‘workbooks’ failed
the file to open is not currently open, nor is it being used by someone else
I appreciate any help. Thx.
...


VBA Code:
FileToOpen = Application.GetOpenFilename(Title:="Browse for the SUPPLIER File you saved & SELECT it", ButtonText:="Choose SUPPLIER Dec Sheet")

   If FileToOpen <> False Then
       Set OpenBook = Application.Workbooks.Open(FileToOpen)
...
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
1. Is there a limit on the number of (or "level" of) "nested" folders-within-folders that this code can access to open?… I moved FILE TO BE OPENED to a "parent" folder and it worked!
2. Is there a way to tell whether the folder itself is corrupted?

It is strange--to me-- that just putting the files in the “parent” folder resolved the issue.
Just to test, I put the files back in the “sub folder”, ran the macro, and I got the same error message again!
:confused2:
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,291
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top