+ Reply to Thread
Results 1 to 8 of 8

VBA Code - Run-time Error 1004 can't find file

  1. #1
    Registered User
    Join Date
    12-26-2017
    Location
    Portland, OR, USA
    MS-Off Ver
    2016
    Posts
    4

    VBA Code - Run-time Error 1004 can't find file

    Hello,

    I am VERY new to VBA and I am getting a strange error when I run my macro. The code is below and the goal is to combine "Sheet1" of several workbooks into a new workbook (basically making a master for all of my spreadsheets). When I run it, I get the error pictured below, however, the file it cannot find is definitely in the folder. Can anyone help me solve this error? THANK YOU!

    Capture.PNG

    CODE:
    Please Login or Register  to view this content.
    Last edited by hhelgerson; 12-26-2017 at 05:02 PM. Reason: Issue Solved

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: VBA Code - Run-time Error 1004 can't find file

    Try:

    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    12-26-2017
    Location
    Portland, OR, USA
    MS-Off Ver
    2016
    Posts
    4

    Re: VBA Code - Run-time Error 1004 can't find file

    Thank you! This did solve my error from above however, now the macro is only pulling data from half of the workbooks. I have 4 saved in the folder right now and it is pulling data from 2. They are all the same file format so I'm not sure why its not pulling from them all. Are you familiar with this? Thanks!

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: VBA Code - Run-time Error 1004 can't find file

    What are the workbooks called?

  5. #5
    Registered User
    Join Date
    12-26-2017
    Location
    Portland, OR, USA
    MS-Off Ver
    2016
    Posts
    4

    Re: VBA Code - Run-time Error 1004 can't find file

    Issues.xlsm and Taxes.xlsm are the ones that work the macro. Green Energy.xlsm and Title.xlsm are the ones that don't.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: VBA Code - Run-time Error 1004 can't find file

    Seems to work ok for me:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    12-26-2017
    Location
    Portland, OR, USA
    MS-Off Ver
    2016
    Posts
    4

    Re: VBA Code - Run-time Error 1004 can't find file

    Strange, I will keep trying. I appreciate all of your help!

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: VBA Code - Run-time Error 1004 can't find file

    I guess I/we would need to see samples of all live files with any sensitive data anonymised. It may be the files are being processed but maybe overwriting previous data.

+ 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. Error Code 1004 - Can't find File
    By Scacks in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-15-2017, 04:05 PM
  2. Run Time Error 1004 (VBA Code)
    By Cheezee in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-26-2015, 04:47 PM
  3. Replies: 4
    Last Post: 11-15-2013, 05:03 PM
  4. VBA Code...error = run time error 1004 autofilter method of range class failed
    By Dariusd7 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-15-2013, 04:49 PM
  5. Run Time Error 1004 and I can't Find the Issue
    By tracymickeyd in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-07-2013, 02:37 PM
  6. Run Time Error 1004 on code
    By aftabn10 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-24-2011, 09:46 AM
  7. Code Run-time error '1004'
    By superbob in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-11-2010, 09:18 AM

Tags for this Thread

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