+ Reply to Thread
Results 1 to 10 of 10

Run-time error '1004': Method Range of object_Worksheet Failed (because of wrong code)

  1. #1
    Registered User
    Join Date
    12-29-2010
    Location
    Italy
    MS-Off Ver
    Excel 2003
    Posts
    34

    Run-time error '1004': Method Range of object_Worksheet Failed (because of wrong code)

    Hello to the board!

    Anyone can say what in this code is wrong, please?
    Please Login or Register  to view this content.
    I take this when try to save: Excel Wrong Code - 2018-11-13_11-36-42.png

    Thanks in advance!
    Last edited by milt2010; 11-13-2018 at 08:48 AM. Reason: Correction in the title of post

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Wrong code

    There's nothing obvious.

    Would you upload the workbook so that we can see the problem in context.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    12-29-2010
    Location
    Italy
    MS-Off Ver
    Excel 2003
    Posts
    34

    Re: Wrong code

    https://mega.nz/#!fwpUyQaB!7-R5eMij6...ie89BKB0XroIvU

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,865

    Re: Wrong code

    Please take a moment to read the forum rules and then amend your thread title to something descriptive of your problem - not what you think the answer might be. (think google search terms?). Once you have done this please send me a PM and I will remove this request. (Also, include a link to your thread - copy from the address bar)

    Many members search our previous posts, and thread titles play a big part of the search. I doubt anybody would do a search based on your title?

    To change a Title on your post, click EDIT POST then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (note: this change is not optional )
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Wrong code

    ...and after the change of Title, would you upload to this forum rather than a file hosting site please.

  6. #6
    Registered User
    Join Date
    12-29-2010
    Location
    Italy
    MS-Off Ver
    Excel 2003
    Posts
    34

    Re: Wrong code

    As I explain to alansidman, in a PM I can't at this moment to change the title because I really don't know where or what is the problem! Only when I try to save I take a "wrong message"... Also, offcourse, I tried to send by the site, but, from the Attachment is impossible... ExcelForum 2018-11-13_14-09-49.png

  7. #7
    Registered User
    Join Date
    12-29-2010
    Location
    Italy
    MS-Off Ver
    Excel 2003
    Posts
    34

    Re: Wrong code

    Finally I find how to send the file...
    Attached Files Attached Files

  8. #8
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Wrong code

    Hi,

    I don't encounter any problem with the code. I notice that you no longer have the 2nd line beginning ActiveSheet.Protect in your first post

    Would you clarify when the problem arises.

  9. #9
    Registered User
    Join Date
    12-29-2010
    Location
    Italy
    MS-Off Ver
    Excel 2003
    Posts
    34

    Re: Run-time error '1004': Method Range of object_Worksheet Failed (because of wrong code)

    Hello,
    I actually deleted the second line because it creates another problem: it does not allow me to use a function (a column that works as a hyperlink to open another worksheet in the same workbook). This is the piece of code I'm talking about: Hyperlink Code2.png. And, in general, with the protected worksheet, it blocks me several other functions (maybe the security string should be improved ... I do not know. But with or without this line (the protection line), the problem (Runtime error...) still appears. It appears only when I save the workbook from the Visual Basic Window. I re-send the same file with the protection line I had removed.
    Thank you for the help!
    Attached Files Attached Files
    Last edited by milt2010; 11-13-2018 at 04:31 PM.

  10. #10
    Registered User
    Join Date
    12-29-2010
    Location
    Italy
    MS-Off Ver
    Excel 2003
    Posts
    34

    Re: Wrong code

    It seems that the problem is due to the code to display the date of the save. After deleting it, the "runtime error ..." no longer appears. Is there a way I can use to correct instead of deleting the save date code? http://bit.ly/2PvIQgq

+ 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] Please, help me with the code for Similarity Factor Calc. My code gives wrong number.
    By Invictus1 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-22-2015, 09:52 PM
  2. what is wrong with this code- error from vba code
    By punna111 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-14-2013, 03:14 PM
  3. What's wrong with my code?
    By EXLent in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-13-2012, 02:43 AM
  4. Code for email alerts from excel isn't working, wrong code possibly?
    By jessthorogood in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-27-2012, 01:45 AM
  5. Wrong line of code banned me out and can't access vba code...
    By albertc in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 05-14-2012, 02:41 PM
  6. What's wrong with my code ?
    By christophe meresse in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 06:05 PM
  7. [SOLVED] What's wrong with my code ?
    By christophe meresse in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 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