+ Reply to Thread
Results 1 to 3 of 3

Code execution stops after .insert method

  1. #1
    Registered User
    Join Date
    04-02-2011
    Location
    Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    38

    Code execution stops after .insert method

    Has anyone had this problem? No matter what I do, code execution seems to just stop after executing the .insert method. For example:
    Please Login or Register  to view this content.
    no matter what code is after .insert, it executes as if .insert was the last line of code in the sub.
    Last edited by deucejmp; 05-21-2013 at 12:39 PM.

  2. #2
    Valued Forum Contributor wenqq3's Avatar
    Join Date
    04-01-2013
    Location
    Malaysia
    MS-Off Ver
    Excel 2003
    Posts
    868

    Re: Code execution stops after .insert method

    I try using your code,and add another row after .insert, it run okie.

    Please Login or Register  to view this content.
    Can see your problem code?
    -If the problem is solved, please mark your thread as Solved: Click Thread Tools above your first post, select "Mark your thread as Solved".

    -Always upload a workbook before start your question
    To attach a file, push the button with the paperclip (or scroll down to the Manage Attachments button), browse to the required file, and then push the Upload button.

    +++ If my answer(s) helped you, please add me reputation by click on * +++

  3. #3
    Registered User
    Join Date
    04-02-2011
    Location
    Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: Code execution stops after .insert method

    First off; I had a typo in my post. That last line was meant to say that it "executes as if .insert was the last line of code in the sub" (I've edited it).

    Second off; Monday night I closed excel after packing up for the night and Tuesday after opening excel again the code ran fine and execution doesn't stop immediately following .insert--apparently this was one of those unexplained glitches in VBA. One of my engineering professors told me once that as much as it may sometimes appear so, nothing is ever random. While this is of course 100% true; VBA does on a rare basis seem to inexplicably behave erratically and I guess this was one of those times. I need to remember that when facing unexplained behavior in VBA, I need to shut down excel first before wasting anytime trying to understand it further. Because that was the one thing I never did Monday when trying to understand what was going on, and over the course of the day when ever I came back to looking at this code execution problem with .insert, it consistently behaved in that manner (stopped code execution). No errors, messages, or prompts...like I said, it was as if .insert was the last line of code in the sub.

    In anycase; issue resolved. I would say "problem" resolved, but there never really was a real problem.

+ 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