+ Reply to Thread
Results 1 to 3 of 3

(Need Help) VBA use with multiple Instances of the Excel App

  1. #1
    Registered User
    Join Date
    05-04-2013
    Location
    Pleasant Hill, CA
    MS-Off Ver
    Excel 2010
    Posts
    19

    Question (Need Help) VBA use with multiple Instances of the Excel App

    I have done much research and including my "Power Programming with Excel" book but I cannot seem to grasp how I might do something like allow an inputbox to grab and reference a range fro a separate application of Excel than the one which the owns the macro. The inputbox functions within the current application, so by selecting a separate application I might as well be selecting a range of cells on a table within on an HTML file found on the internet. I would be very pleased if someone could provide me with and explain the syntax to perform such an operation (if possible). I simply want to run an inputbox, select a range from a workbook in a separate instance of excel, and import the data from that range to the instance of excel which owns the macro so that the output can be in that workbook. Thanks in advance.

  2. #2
    Valued Forum Contributor AlvaroSiza's Avatar
    Join Date
    09-19-2007
    Location
    Staffordshire
    MS-Off Ver
    2007
    Posts
    591

    Re: (Need Help) VBA use with multiple Instances of the Excel App

    You just need to declare each instance of Excel as a variable and then reference the appropriate variable as applicable.

    The workbook containing the macro (the "original" workbook) is your active workbook and should be declared as such.
    Please Login or Register  to view this content.
    Then set another workbook variable equal to the other workbook. This assumes you know the name of the workbook you are trying to access.From an '05 post on this forum
    Please Login or Register  to view this content.
    Perhaps it was the Noid who should have avoided me...
    If you are satisfied with my solution click the small star icon on the left. Thanks
    1. Make a copy of your workbook and run the following code on your copy (just in case)
    2. With excel open, press ALT+F11 to open the Visual Basic Editor (VBE). From the "Insert" menu, select "Module".
    3. Paste the code from above into the empty white space. Close the VBE.
    4. From the developer tab, choose "Macros", select the Sub Name, and click "Run".

  3. #3
    Registered User
    Join Date
    05-04-2013
    Location
    Pleasant Hill, CA
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: (Need Help) VBA use with multiple Instances of the Excel App

    It is amazing how much insight that one little bit of code gave me into the object structure of Excel and VBA. Thanks, I really appreciate your help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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