+ Reply to Thread
Results 1 to 4 of 4

Runtime Error 1004; Method 'OLEObjects' of object '_Worksheet' failed

  1. #1
    Registered User
    Join Date
    06-15-2014
    Posts
    18

    Runtime Error 1004; Method 'OLEObjects' of object '_Worksheet' failed

    Hi everyone! I have this code that auto generate a number (000001) in the text box (textbox is located in the sheet 2) when a button in sheet one is clicked. when a button in sheet2 is clicked (its function is to direct the user in sheet1) it deducts the current generated number by 1, it also requires to continue the generated number its sequel even if the file is closed and saved. Attached herewith is a copy of error and a highlighted part where it says Runtime Error 1004; Method 'OLEObjects' of object '_Worksheet' failed Im using Excel 2007. Thanks a million times. The first code is assigned in the button one in sheet one and the second code is assigned in button 2 in sheet2
    Please Login or Register  to view this content.
    Last edited by Adnamut; 06-23-2014 at 11:35 PM. Reason: Added Code Tags

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Runtime Error 1004; Method 'OLEObjects' of object '_Worksheet' failed

    Hello Adnamut,

    I don't see anything wrong with how the code is written. I created a similar setup in a test workbook and it works. Although I am using Office 2010, there is nothing in your code that wouldn't work with 2010.

    Have you tried saving the workbook, closing Excel, restarting Excel, and reopening the workbook? Sometimes Excel get overloaded when coding in VBA and what should work, stops working.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    06-15-2014
    Posts
    18

    Re: Runtime Error 1004; Method 'OLEObjects' of object '_Worksheet' failed

    Hi Leith Ross. Actually its a code from another workbook. In that workbook this code functions well and when I tried to migrate it in another workbook I use to have this error stated above. codes that are highlighted are the one in red (please see the code above) Ive been working with this since yesterday huhu. I am newbie in this vba. I hope you could help me any form of advices will be highly appreciated. Thank

  4. #4
    Registered User
    Join Date
    06-15-2014
    Posts
    18

    Re: Runtime Error 1004; Method 'OLEObjects' of object '_Worksheet' failed

    Quote Originally Posted by Leith Ross View Post
    Hello Adnamut,

    Have you tried saving the workbook, closing Excel, restarting Excel, and reopening the workbook? Sometimes Excel get overloaded when coding in VBA and what should work, stops working.
    This work! Thaaaank you lei! I wasn't able to closed the excel file for a week now! thanks

+ 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. Runtime Error '1004': Method 'Pivot Tables' of object '_Worksheet' Failed
    By ZuneidDassu in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 04-07-2014, 06:21 AM
  2. [SOLVED] Runtime Error '1004' Method 'Range' of object '_Worksheet' failed
    By ovalstar in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-20-2013, 02:15 PM
  3. [SOLVED] Help! Error 1004, method 'Range' of object'_Worksheet' failed.
    By zac_595 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-07-2013, 02:55 PM
  4. [SOLVED] Runtime error 1004: Method 'Range' of object '_Worksheet' failed
    By Phil Payne in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-17-2013, 01:30 AM
  5. Receiving runtime error 1004: Method 'Range' of object '_Worksheet' failed
    By DrShocktopus in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-28-2010, 10:39 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