+ Reply to Thread
Results 1 to 4 of 4

Excel always error??

  1. #1
    Forum Contributor
    Join Date
    03-31-2012
    Location
    Hong Kong
    MS-Off Ver
    Excel 2010
    Posts
    140

    Excel always error??

    Why Excel always error and stop during run follow code? [let Cells(2,2)=10]

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  2. #2
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Excel always error??

    Remove the "End" statement (2 occurrences).

    From Excel help file :
    "The End statement stops code execution abruptly, ...."

    Because you call WinAPI function, you must be very carefull, don't treat affected sub/function like you call them without WinAPI.
    When you call the SetTimer/KillTimer, these functions expect a valid exit point of the sub Main, but in your code, before they can reach it, you have already terminate the process using "End" statement.
    1. I care dog
    2. I am a loop maniac
    3. Forum rules link : Click here
    3.33. Don't forget to mark the thread as solved, this is important

  3. #3
    Forum Contributor
    Join Date
    03-31-2012
    Location
    Hong Kong
    MS-Off Ver
    Excel 2010
    Posts
    140

    Re: Excel always error??

    Thanks for your teach, I always assumed "End" is need for process to stop timer.

  4. #4
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Excel always error??

    You are welcome, glad I can help.

+ 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: run time error 1004: Application-defined or Object-defined error in excel 2013
    By AnanthKrishna in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-13-2015, 06:16 AM
  2. Run time error 75 (Path/File Access Error) - Excel 2007 on XP SP3
    By Portuga in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-30-2014, 10:39 AM
  3. Excel macro (compile error. syntax error.) error
    By salar_younis in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-06-2014, 06:11 AM
  4. Facing 'run-time error -2147217871 (80040e31) Automation error' in excel VBA
    By junaidanjum in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-25-2013, 03:48 AM
  5. Excel xmlHTTP object error message - system/runtime error
    By Porky2007 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-23-2007, 09:36 AM

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