+ Reply to Thread
Results 1 to 4 of 4

Workbooks Loop Run-time error '1004':

  1. #1
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Brazil
    MS-Off Ver
    Excel 2007 & 2013
    Posts
    268

    Workbooks Loop Run-time error '1004':

    Hello,

    I am looping through workbooks, whenever file name has "CAP CPU" on its file name it opens the Workbook, using the below code:

    Please Login or Register  to view this content.

    Here is the error I am getting
    Run-time error '1004':
    Sorry, we couldn't find CAP CPU_New.xlsm. Is it possible it was moved, renamed or deleted?

    I am using Windows 7, and the file is in the correct folder. By looping with F8 I can see StrFile gets the correct file name "CAP CPU_New.xlsm".
    It is strange that it worked twice, now, it is not working anymore.

    Can anyone help me please?

    Thanks!!
    Last edited by trizzo; 03-26-2015 at 09:37 AM.

  2. #2
    Forum Contributor
    Join Date
    03-04-2014
    Location
    Canada Eh
    MS-Off Ver
    Excel 2010
    Posts
    199

    Re: Workbooks Loop Run-time error '1004':

    Perhaps the following (small change):
    Please Login or Register  to view this content.
    Click the * to give Rep to a post you like.

  3. #3
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Brazil
    MS-Off Ver
    Excel 2007 & 2013
    Posts
    268

    Re: Workbooks Loop Run-time error '1004':

    Hey Mad-Mizer, thanks for quick response!! But, it is still not working.

  4. #4
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Brazil
    MS-Off Ver
    Excel 2007 & 2013
    Posts
    268

    Re: Workbooks Loop Run-time error '1004':

    Can anyone help me, please? The issues seems to be with Application.Workbooks.Open (StrFile). Thanks!
    Last edited by trizzo; 03-26-2015 at 12:03 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] run-time error '1004' method 'open' of object 'workbooks' failed
    By mattress58 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-03-2016, 06:24 PM
  2. Run Time Error -'1004' - while copying data between workbooks
    By prabhuduraraj09 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-26-2014, 03:23 AM
  3. Run-time error '1004' for .Refresh BackgroundQuery:=False for loop
    By Robo25 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-12-2013, 01:16 AM
  4. Run time Error 1004 in my Do While loop
    By Kicassrt in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-18-2013, 09:27 PM
  5. Array loop producing error "Run time error '1004'"
    By jeskit in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 05-06-2011, 08:56 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1