+ Reply to Thread
Results 1 to 13 of 13

Error 1004

  1. #1
    Registered User
    Join Date
    04-22-2021
    Location
    Montréal
    MS-Off Ver
    2103
    Posts
    11

    Error 1004

    Hi all!

    Does anyone could tell me why my macro was working until today?!

    Thanks!
    Attached Images Attached Images

  2. #2
    Registered User
    Join Date
    04-22-2021
    Location
    Montréal
    MS-Off Ver
    2103
    Posts
    11

    Re: Error 1004

    Here's a small format of my Excel file.
    Attached Files Attached Files

  3. #3
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,424

    Re: Error 1004

    .
    If you are running your macro from Sheet2 ... Excel assumes the sheet to paste to is Sheet2.

    If you run your macro from Sheet1 .. Excel assumes you want to paste to Sheet1.

    You can make the macro run from any sheet by specifying the sheet name to paste to, as seen here :

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    04-22-2021
    Location
    Montréal
    MS-Off Ver
    2103
    Posts
    11

    Re: Error 1004

    Hi Logit...

    I will try what you told me but here's the same file with a little addon that I forgot in to put in the first one.
    When you select the second sheet the macro should run automatically.
    Strangely all this was working fine until today!
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    04-22-2021
    Location
    Montréal
    MS-Off Ver
    2103
    Posts
    11

    Re: Error 1004

    Well, I copied and paste your code and I got the same error message.

    Maybe you remind talking to me...check my previous post.

    I had find the solution but apparently it hasn't last.

    Maybe we can do it other way?!

  6. #6
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,424

    Re: Error 1004

    If you select Sheet1 ... then close the workbook ... then re-open the workbook ... you can then select Sheet2 and when it is activated, the auto macro works.

    If your desire is to have the macro run when the workbook opens, you will need to place your Call to the macro in the ThisWorkbook module like this :

    Please Login or Register  to view this content.

  7. #7
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,424

    Re: Error 1004

    Excel does not consider opening the workbook to Sheet2 as "activating" Sheet2.

    Activating a sheet only occurs when you come from a different worksheet ... to Sheet2.


    The Error 1004 you are receiving ... I don't understand why. Your macro functions here without the error message.

  8. #8
    Registered User
    Join Date
    04-22-2021
    Location
    Montréal
    MS-Off Ver
    2103
    Posts
    11

    Re: Error 1004

    Sorry but did I understand right???

    You are saying that MY macro is working for you?!

  9. #9
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,424

    Re: Error 1004

    Yes. Please see attached file.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    04-22-2021
    Location
    Montréal
    MS-Off Ver
    2103
    Posts
    11

    Re: Error 1004

    I got the same error message...

    ...so it may be my software that is corrupted or something like this...do you think?

  11. #11
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,424

    Re: Error 1004

    .
    I agree. There is something else going on with your copy of Excel.

    You can attempt to repair your installed version of Excel. Google for "Excel 2013 Repair"

    Worse case scenario would be to reinstall Excel and see what happens.

    Best wishes.

  12. #12
    Registered User
    Join Date
    04-22-2021
    Location
    Montréal
    MS-Off Ver
    2103
    Posts
    11

    Re: Error 1004

    For those who would encounter the same issue...

    Just delete files from

    C:\Users\user name\AppData\Local\Microsoft\Office\16.0\OfficeFileCache

    I did and now everything is working again.

  13. #13
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,424

    Re: Error 1004

    .
    Glad you found an answer.

    Cheers !

+ 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. [SOLVED] I am getting error as "Run Time error '1004' Microsoft excel cannot paste the data
    By Amittapre in forum Excel Programming / VBA / Macros
    Replies: 43
    Last Post: 03-24-2017, 04:40 PM
  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