+ Reply to Thread
Results 1 to 11 of 11

Execution of Macro Stops

  1. #1
    Registered User
    Join Date
    10-01-2010
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2007
    Posts
    38

    Execution of Macro Stops

    I am facing a peculiar problem while running a macro in Excel 2007. This macro is being run in an excel file named "Test.xlsm". My macro code is as under -

    Please Login or Register  to view this content.
    Now the problem is that the code runs without any problem in the debug mode. But when I execute the code using the shortcut key assigned to the macro, the program stops after opening the file in line no. 1.

    Can someone suggest a solution to this problem.
    Last edited by romperstomper; 10-03-2010 at 06:57 AM. Reason: mark solved

  2. #2
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Execution of Macro Stops

    1. You need to use code tags around your code.

    2. Can you give a bit more information? Does the macro just not execute commands after the first line or does it produce an error? If the latter, what is the error?

  3. #3
    Registered User
    Join Date
    10-01-2010
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2007
    Posts
    38

    Re: Execution of Macro Stops

    Quote Originally Posted by Andrew-R View Post
    1. You need to use code tags around your code.

    2. Can you give a bit more information? Does the macro just not execute commands after the first line or does it produce an error? If the latter, what is the error?
    1. Sorry. Now rectified.

    2. Macro just does not execute commands after the line indicated. In my actual program it is not the first line. No error message is displayed. No problem encountered in debug mode.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: Execution of Macro Stops

    Might be worth sharing all the code and, ideally a sample workbook that demonstrates the problem.

    I've stepped through the code manually and with a breakpoint on the code when pressing a command button and run it uninterrupted. The only issue I had was breaking the links but when I went into debug and stepped through it worked ... may be a timing problem.

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  5. #5
    Registered User
    Join Date
    10-01-2010
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2007
    Posts
    38

    Re: Execution of Macro Stops

    Quote Originally Posted by TMShucks View Post
    Might be worth sharing all the code and, ideally a sample workbook that demonstrates the problem.

    I've stepped through the code manually and with a breakpoint on the code when pressing a command button and run it uninterrupted. The only issue I had was breaking the links but when I went into debug and stepped through it worked ... may be a timing problem.

    Regards
    The actual code is not very different from the one I reproduced earlier and the same is given below. I will try to prepare a sample workbook and post, if possible.

    I want to again point out that the code runs properly on stepping through or running uder debug mode. Only while executing the macro from outside it stops.

    About breaking the link problem, I wanted to handle that later. However, any suggestion is welcome.

    Please Login or Register  to view this content.

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Execution of Macro Stops

    If your shortcut key combination uses the Shift key, switch to one that doesn't use it.
    Remember what the dormouse said
    Feed your head

  7. #7
    Registered User
    Join Date
    10-01-2010
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2007
    Posts
    38

    Re: Execution of Macro Stops

    Quote Originally Posted by romperstomper View Post
    If your shortcut key combination uses the Shift key, switch to one that doesn't use it.
    Thanks romperstomper. It ran smooth like knife through butter.

    Even breaking of links did not give a problem this time.

    Thanks a lot.

    What could be the reason/rationale for this though.

  8. #8
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: SOLVED : Execution of Macro Stops

    It's a bug. See this MSKB article.

  9. #9
    Registered User
    Join Date
    10-01-2010
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2007
    Posts
    38

    Re: SOLVED : Execution of Macro Stops

    Quote Originally Posted by romperstomper View Post
    It's a bug. See this MSKB article.
    OK. Thanks.

  10. #10
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: SOLVED : Execution of Macro Stops

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  11. #11
    Registered User
    Join Date
    10-01-2010
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2007
    Posts
    38

    Re: SOLVED : Execution of Macro Stops

    Quote Originally Posted by pike View Post
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save
    Thanks Pike. I did not know that there was a way to mark the thread as SOLVED. Hence I had edited the subject and prefixed the Same with "SOLVED".

    Anyway now I know.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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