+ Reply to Thread
Results 1 to 7 of 7

VBA Some way to pass Data to another Application(Instance) of Excel

  1. #1
    Registered User
    Join Date
    10-09-2010
    Location
    Seku
    MS-Off Ver
    Excel 2003
    Posts
    27

    VBA Some way to pass Data to another Application(Instance) of Excel

    Hello everyone,

    After many many fails, I've decided to ask for help.
    Details: (Excel 2003, Windows 7, 64bit, I am not a programmer)

    I have 2 Excel files "Main" and "Report", open in 2 screens.
    Chain of events: "Main" does some calculations and shows the results as a draft to me in the form of text, then copies those results, goes to "Report", finds the last line of data and pastes the text there also.

    So far I use the "Arrange Vertical" option to have the files in a way that the report shows at the 2nd screen and Main remains at my screen.
    That is causing quite the inconvenience since I need to use many applications at the same time and that can be frustrating without minimizing the report and generally prohibits any independent window resizing.
    Even if I tried to minimize Excel via the 'close' button, it's located at the 2nd screen which is not in front of me... Thus two different applications of excel would make my life much MUCH easier.


    I have checked several articles to similar questions but nothing has worked so far.
    I need some way to paste the results to "Report" while it's open as another application.

    Thank you in advance.

    PS. When I manually copy and paste, it works just fine, but I haven't found a way to specify, select or manipulate the "Report.xls" excel application in any way.
    Last edited by XeRo13g; 07-23-2017 at 11:18 AM. Reason: Flag - Solved

  2. #2
    Registered User
    Join Date
    10-15-2013
    Location
    Hawaii
    MS-Off Ver
    Excel 2007
    Posts
    63

    Re: VBA Some way to pass Data to another Application(Instance) of Excel

    You should be able to open the first file; then open Excel again using the Start menu shortcut, which should open a second instance, from which you open the second file.

  3. #3
    Registered User
    Join Date
    10-09-2010
    Location
    Seku
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: VBA Some way to pass Data to another Application(Instance) of Excel

    Opening the "Report" as another excel application is not the problem, transferring or pasting values is...

  4. #4
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: VBA Some way to pass Data to another Application(Instance) of Excel

    Example for the OP...
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    10-09-2010
    Location
    Seku
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: VBA Some way to pass Data to another Application(Instance) of Excel

    Thank you for the reply, I have included some of my code in your example to demonstrate the type of text I need to pass through.
    Most importantly, when the Public Enum is not deactivated, every time the code finds an application it gives a compile error for Invalid qualifier.
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: VBA Some way to pass Data to another Application(Instance) of Excel

    I don't get that issue, and tested on Excel 2002/2010/2016.... with different versions of Windows from XP up so am at a loss to explain. However, I removed the Enum, it was more a convenience when coding than anything else. Just use the appropriate value (0=Worksheet, 1 = Workbook, 2 = Application) instead.


    Attached
    Attached Files Attached Files
    Last edited by cytop; 07-23-2017 at 10:03 AM.

  7. #7
    Registered User
    Join Date
    10-09-2010
    Location
    Seku
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: VBA Some way to pass Data to another Application(Instance) of Excel

    cytop, your code works nicely!

    I've been trying to figure out how to manipulate the other Excel Application(Report) and I've come to realize that is not very simple.
    Probably because I don't quite understand exactly how your code works.

    I've tried to update some links between the 2 applications using:

    Please Login or Register  to view this content.
    ...which was an utter failure! I doubt that this is even possible.

    To circumvent the external formulas, I've tried to use the same copy/paste method on a Range that is larger than a single cell and I've found out
    that can't be pasted in a single cell(much like right click, paste) and even when the copied range has the same size as the destination Range, I
    still got an error that it's NOT the same size!?

    I did manage to use a loop for pasting the cells one by one, which is an improvement but still quite slow.
    Generally, I've found out that this is a headache and it cost me 3 days of my vacation, yet it still worth every second spent if I finally get this to work. (Any further aid would be also appreciated)

    Thanks again, the least I could do is add rep.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Application.Run several instance
    By lesoies in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-23-2013, 05:14 AM
  2. seperate instance of the Excel application
    By bta in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-22-2012, 08:41 PM
  3. [SOLVED] Analyze Within An Array and Pass Back Once vs. Pass at each applicable Instance
    By AlvaroSiza in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-11-2012, 05:25 PM
  4. Copy sheet to new instance of Excel Application
    By Bob@Sun in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-06-2011, 03:40 PM
  5. new instance Excel application
    By extreme in forum Excel General
    Replies: 3
    Last Post: 06-25-2007, 12:41 AM
  6. Instance still there in task manager after xlapp.Application.Quit
    By Mo in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-27-2005, 12:05 PM
  7. SHELL to open an application and pass parameters to it
    By jwkz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-12-2005, 04:41 PM
  8. Replies: 1
    Last Post: 02-21-2005, 01:06 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