Results 1 to 2 of 2

Determine which macro and line executed last in a VBA macro.

Threaded View

  1. #1
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,167

    Determine which macro and line executed last in a VBA macro.

    I'm not sure if this is possible, and most likely beyond my capabilities.
    I have an Excel template with many Subs and Functions which I am finding it difficult to follow what is happening, or in the order of what is happening.

    I want to add a simple SaveAs bit of code for an Excel file that is automated via a CMM (Coordinate Measuring Machine) software.
    This software reads from three different txt files and places data on a worksheet (Which it names "Report") and somewhere, either in the beginning or near the end of the macro(s) a workbook name is created.
    The way these macros are written and broken into so many routines is difficult to follow or figure out flow.
    The workbook name is generated from one or more of the three txt files used.

    In our process of running parts on the CMM, these excel workbooks are generated automatically.

    My best guess, is, if I can determine which macro and or line of the macro that runs last, I may be able to insert the "SaveAs" code to automatically save the workbook.
    its manually saved now, and far too many times when in a rush, it isn't saved.

    Is there a way with VBA to determine the last Sub/Function and or line of code executed?

    The zip file attached has a .xlt and a .xls file.
    Attached Files Attached Files
    Regards

    Rick
    Win10, Office 365

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro to paste formula in colK after a macro executed
    By acsishere in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-20-2017, 08:39 PM
  2. Macro executed within one tab
    By toplisek in forum Excel General
    Replies: 2
    Last Post: 07-03-2015, 04:49 AM
  3. 400 - error when macro executed
    By dantray02 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 01-10-2014, 09:10 AM
  4. Need macro help restricting when it is executed
    By graduate106 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 05-08-2013, 11:00 AM
  5. [SOLVED] Create Yes/No message box to determine if a macro should be executed
    By poptart141 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-22-2013, 02:18 PM
  6. Replies: 7
    Last Post: 04-19-2006, 03:10 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