+ Reply to Thread
Results 1 to 13 of 13

Run-Time error 1004 Method 'OnTime' of object '_Application' failed

  1. #1
    Registered User
    Join Date
    11-19-2005
    Posts
    20

    Angry Run-Time error 1004 Method 'OnTime' of object '_Application' failed

    I am running the following code which runs until the last line of the StopBlink sub, when it returns the error
    "Run-Time error 1004 Method 'OnTime' of object '_Application' failed". Could someone please explain the issue for me.

    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 04-22-2015 at 09:38 PM. Reason: Added missing CODE tags. Please read and follow the Forum Rules, link above in the menu bar. Thanks.

  2. #2
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,525

    Re: Run-Time error 1004 Method 'OnTime' of object '_Application' failed

    Hi PBM,

    You can only run the StopBlink macro if the StartBlink macro is already running (i.e. the text in cell C2 of Sheet1 is flashing). If the StartBlink macro isn't running and you try and execute the StopBlink macro, you'll get the above error message.

    Please make sure to wrap your code with the appropriate tags.

    Regards,

    Robert
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  3. #3
    Registered User
    Join Date
    11-19-2005
    Posts
    20

    Re: Run-Time error 1004 Method 'OnTime' of object '_Application' failed

    Hi Robert, thanks for your reply. I am not sure what you mean "Please make sure to wrap your code with the appropriate tags" ?

    I was of the understanding that the following Macro in the "ThisWorkbook" open module would run the StartBlink.

    Please Login or Register  to view this content.
    ...Peter
    Last edited by JBeaucaire; 04-22-2015 at 09:38 PM. Reason: Added missing CODE tags.

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Run-Time error 1004 Method 'OnTime' of object '_Application' failed

    what's the code for startblink?

    nvm-I can't read!
    Last edited by JosephP; 08-28-2013 at 03:30 AM.
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  5. #5
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,525

    Re: Run-Time error 1004 Method 'OnTime' of object '_Application' failed

    I am not sure what you mean "Please make sure to wrap your code with the appropriate tags" ?
    Refer Rule 3 here and have a look at how I've wrapped my code below.

    I was of the understanding that the following Macro in the "ThisWorkbook" open module would run the StartBlink.
    Yes, as long as StartBlink is running. If the StartBlink code is stopped at any point while the workbook it is open, the error message will appear when the workbook is attempted to be closed.

    As we're not concerned about the error, you can simply turn off the message from appearing (importantly not fix it) via the following:

    Please Login or Register  to view this content.
    HTH

    Robert

  6. #6
    Registered User
    Join Date
    11-19-2005
    Posts
    20

    Re: Run-Time error 1004 Method 'OnTime' of object '_Application' failed

    Thank you agaion Robert,
    you have managed to turn off the error message which is great. I now have one other issue I hope you can help with. My C2 text does not blink however each time I save & close the workbook upon reopening it my C2 text is either RED or White so the code is partially working.

    Regards..Peter

  7. #7
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,525

    Re: Run-Time error 1004 Method 'OnTime' of object '_Application' failed

    Not sure as it works for me

    If the code isn't firing up when the workbook is opened that would actually explain the original error message!! Are macros always enabled when workbooks are opened? The code is set to work on cell C2 of Sheet1 - that's where you're looking isn't it?

    Also, the following event macros that you posted in #3 above...

    Please Login or Register  to view this content.
    ...needs to be attached to the ThisWorkbook object not simply in a standard module.

    If the issue continues attach the workbook (devoid of any sensitive data if need be) and I'll have a look.

    Robert
    Last edited by Trebor76; 08-27-2013 at 09:03 PM.

  8. #8
    Registered User
    Join Date
    11-19-2005
    Posts
    20

    Re: Run-Time error 1004 Method 'OnTime' of object '_Application' failed

    Hi Robert,
    Yes, Macros are enabled and I am referring & looking at cell C2 of Sheet1.
    Also, the event macro I posted in #3 is attached to the ThisWorkbook object.

    Unfortunately I cannot attach the workbook, when uploading the file it presents an error message and wont allow attaching.

    So I'm stumped now as I guess you cannot help further without a copy of my file. Am I right, or is there something else you can think of?

    Peter

    PS. Just a thought, the text in cell C2 is overflowing to adjacent cells.
    Could this be the cause?

  9. #9
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,525

    Re: Run-Time error 1004 Method 'OnTime' of object '_Application' failed

    Without seeing the patient (i.e. workbook) it's very hard to diagnose the problem.

    That said, have a look at the attached that's working as expected and try and replicate it on your side.

    Regards,

    Robert
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    11-19-2005
    Posts
    20

    Re: Run-Time error 1004 Method 'OnTime' of object '_Application' failed

    Hello again Robert,
    Firstly I must thank you again for taking the time to help me out.

    I looked at the file you created and the code is exactly as mine and in the same locations, the only difference was your first line - Options Explicit
    which I added to my Macros.

    Unfortunately the result still the same, No Blink.

    I attempted to Upload my file again but still receive the same error below, maybe you can shed some light on this issue so I can forward my file as suggested earlier.

    Error Message: 500[IOErrorEvent type="ioError" bubbles=false cancellable=false eventPhase=2 text=ERROR#2038]

    Regards,
    Peter

  11. #11
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,525

    Re: Run-Time error 1004 Method 'OnTime' of object '_Application' failed

    No idea why you can't upload your file (perhaps size?) One of the administrators should be able to help.

    Did my workbook work?

    Robert

  12. #12
    Registered User
    Join Date
    11-19-2005
    Posts
    20

    Re: Run-Time error 1004 Method 'OnTime' of object '_Application' failed

    Yes Robert, your workbook did function in the correct manner so now I am totally stumped why mine doesn't with exactly the same code.
    I will try to find a solution for the file upload issue and if/when I do, will forward my workbook. This may take a while!

    Cheers & thanks again for your time.
    Peter

  13. #13
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,525

    Re: Run-Time error 1004 Method 'OnTime' of object '_Application' failed

    Hey Peter,

    Have you seen my PM to you?

    Robert

+ 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] Run-time error 1004 - Method 'Range' of object'_Global' failed
    By onmyway in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-24-2013, 03:33 PM
  2. Run time error 50290 method 'ontime' of object '_application' failed
    By newengwong in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-21-2012, 08:06 PM
  3. Run Time error 1004 Method Select of Object Worksheet failed
    By AlexMach in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-14-2012, 03:07 AM
  4. Run-time error '1004': Method 'Range' of object 'Global' failed
    By djwestholm in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-22-2012, 04:52 PM
  5. Run time error 1004 - Method 'Range' of 'Object'_Global' failed
    By excelaspire0219 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-10-2009, 01:18 PM

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