Consulting

Results 1 to 3 of 3

Thread: Return control after application.run

  1. #1
    VBAX Newbie
    Joined
    Jan 2011
    Posts
    2
    Location

    Return control after application.run

    I am having a problem returning control to a workbook macro after it calls another macro in a different workbook using the application.run function. The code in the originating workbook is:

    Sub CombineFiles()
    'call the workbook to pick up and combine all good and fixed files and move them to the integration point.


    Sub CombineFiles()
    'call the workbook to pick up and combine all good and fixed files and move them to the integration point.


    'opening workbook
    MsgBox " Going to Combine workbook"

    Workbooks.Open FileName:="V:\2011 supply issued\Upload Processor\COMBINE_FILES.xlsm"
    Application.Run "COMBINE_FILES.xlsm!GetCleanedFiles"
    Application.Run "COMBINE_FILES.xlsm!SummurizeSheets"

    MsgBox "Back from combine workbook"

    End Sub

    It runs both macros fine but does not show the Message from the MsgBox line.

  2. #2
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    There are two scenarios where that might happen or appear to happen. (1) End was used in the run code. (2) The MsgBox() was behind a window.

  3. #3
    VBAX Newbie
    Joined
    Jan 2011
    Posts
    2
    Location
    Kenneth

    Thanks for reply. I checked to see if the msgbox was in the background and it does not appear to be. I run this every morning and will confirm tomorrow this is the case. I have added the code from the last macro called. I don't see anywhere an end statement would cause the process to stop but could be missing something.

    Thanks
    Jeff

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •