+ Reply to Thread
Results 1 to 5 of 5

Can't fix 1004 Error

  1. #1
    Registered User
    Join Date
    07-14-2015
    Location
    Fort Lauderdale, FL
    MS-Off Ver
    2013
    Posts
    3

    Can't fix 1004 Error

    A long time ago Nebu created some coding for me. This code has worked for years until now. All of a sudden I'm getting the dreaded Runtime Error 1004 "Application-defined or Object-defined error"

    I have tried everything I can think of but the error keeps showing up every time I run the code. Can anyone shed some light on this error from the code below, please.

    I'm using Office 365

    Please Login or Register  to view this content.
    Thanks in advance...
    Terry E

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,908

    Re: Can't fix 1004 Error

    Where does the error occur?
    Rory

  3. #3
    Registered User
    Join Date
    07-14-2015
    Location
    Fort Lauderdale, FL
    MS-Off Ver
    2013
    Posts
    3

    Re: Can't fix 1004 Error

    I'm not sure. I tried stepping through the code and it does everything until the "Msg Box" line. It paste all the lines pulled form all the sheets. It fails, I guess, right before the date part. I say that because I commented out all the date stuff and the 1004 error was still thrown. Is there some testing that I can do that will narrow down the problem code? I'm not a VBA programmer but I am a geek and can follow code blocks.

    It runs through all the statements and pulls all the invoices (what it's supposed to do) but at the very end of the run the error is thrown. The date doesn't change and the "Msg Box" does now display "Task Complete" but I can't figure out what line is causing the problem. This all worked until 2 weeks ago. I run this every Monday and it worked June 3rd an 10th but failed on the 17th.

    Terry E

  4. #4
    Registered User
    Join Date
    11-06-2012
    Location
    Texas
    MS-Off Ver
    O365
    Posts
    27

    Re: Can't fix 1004 Error

    Try qualifying which sheet the last set of Range commands apply to. eg: Sheets("Sheet1").Range(…)

  5. #5
    Registered User
    Join Date
    07-14-2015
    Location
    Fort Lauderdale, FL
    MS-Off Ver
    2013
    Posts
    3

    Re: Can't fix 1004 Error

    Eureka!

    After 6.5 hours of search and implement, I finally figured it out. We had a power outage and when the computer shutdown it left some hidden files behind that were throwing off the code.

    First off, thanks for all the help. The problem was another VERY hidden file. Unchecking the "show hidden..." did not show this file, it was "desktop.ini". Once I found it, and I only found it with a 2nd macro file that showed a hidden file ~?CMS displayed. I missed this one in the list because it simply showed up in the "Ds" instead of at the bottom of the list like the ~?CMS file did.

    The code is working now and I want to say a big thank you for taking the time to help.

    Terry E

+ 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. VBA error: runtime error 1004 : Method range of object - 'Global' failed.
    By Afjio12 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-28-2019, 04:37 AM
  2. Runtime error '1004': Paste special method of range class error.
    By Daryl Zer0 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-05-2014, 01:44 AM
  3. [SOLVED] Sort Macro Run-time error '1004': Application/Object-defined error.
    By sam1212 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-22-2014, 10:05 AM
  4. [SOLVED] VBA Error: Runtime Error 1004: AutoFilter method of Range class failed
    By jl22stac in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-03-2013, 07:27 PM
  5. [SOLVED] Getting Error 1004 Object or Application Defined Error - Code to rearrange data
    By BlazzedTroll in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 06-10-2013, 12:10 PM
  6. Error "run-time Error '1004': General Odbc Error
    By D4WNO77 in forum Access Tables & Databases
    Replies: 2
    Last Post: 07-16-2012, 09:55 AM
  7. Error 75 File/Path access error, sometimes Error 1004
    By smokebreak in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 02-16-2011, 02:35 PM

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