+ Reply to Thread
Results 1 to 7 of 7

How to reference to other Excel application in VBA

  1. #1
    Łukasz Szczepański
    Guest

    How to reference to other Excel application in VBA

    Hi,

    I would like to copy some data to my spreadsheet from workbook which is
    opened from web. The problem is that "Export to Excel" button always opens
    new Excel application, so I can't reference to new workbook from VBA.

    How can I check other running applications and how to copy data from other
    Excel application to my workbook?

    Thanks in advance,

  2. #2
    Tom Ogilvy
    Guest

    RE: How to reference to other Excel application in VBA

    have you tried to use GetObject. See excel vba help for details.

    --
    Regards,
    Tom Ogilvy


    "Łukasz Szczepański" wrote:

    > Hi,
    >
    > I would like to copy some data to my spreadsheet from workbook which is
    > opened from web. The problem is that "Export to Excel" button always opens
    > new Excel application, so I can't reference to new workbook from VBA.
    >
    > How can I check other running applications and how to copy data from other
    > Excel application to my workbook?
    >
    > Thanks in advance,


  3. #3
    Łukasz Szczepański
    Guest

    RE: How to reference to other Excel application in VBA

    Yes, but I failed. I have no idea what arguments should I use

    GetObject([pathname] [, class])

    A new workbook is not saved at the stage I would like to access it, and file
    name is random (but hopefully with the same prefix).

    Thanks,

    Lukasz

    "Tom Ogilvy" wrote:

    > have you tried to use GetObject. See excel vba help for details.
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "Łukasz Szczepański" wrote:
    >
    > > Hi,
    > >
    > > I would like to copy some data to my spreadsheet from workbook which is
    > > opened from web. The problem is that "Export to Excel" button always opens
    > > new Excel application, so I can't reference to new workbook from VBA.
    > >
    > > How can I check other running applications and how to copy data from other
    > > Excel application to my workbook?
    > >
    > > Thanks in advance,


  4. #4
    Tom Ogilvy
    Guest

    RE: How to reference to other Excel application in VBA

    set o = GetObject(,"Excel.Application")
    ? o.Caption
    Microsoft Excel


    Assuming you don't have multiple instances of Excel open except the one you
    are trying to get and the instance in the web page. I would assume the
    instance in the web page would not be detected by GetObject, but I haven't
    test it.

    --
    Regards,
    Tom Ogilvy



    "Łukasz Szczepański" wrote:

    > Yes, but I failed. I have no idea what arguments should I use
    >
    > GetObject([pathname] [, class])
    >
    > A new workbook is not saved at the stage I would like to access it, and file
    > name is random (but hopefully with the same prefix).
    >
    > Thanks,
    >
    > Lukasz
    >
    > "Tom Ogilvy" wrote:
    >
    > > have you tried to use GetObject. See excel vba help for details.
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > >
    > > "Łukasz Szczepański" wrote:
    > >
    > > > Hi,
    > > >
    > > > I would like to copy some data to my spreadsheet from workbook which is
    > > > opened from web. The problem is that "Export to Excel" button always opens
    > > > new Excel application, so I can't reference to new workbook from VBA.
    > > >
    > > > How can I check other running applications and how to copy data from other
    > > > Excel application to my workbook?
    > > >
    > > > Thanks in advance,


  5. #5
    Łukasz Szczepański
    Guest

    RE: How to reference to other Excel application in VBA

    Unfurtunately it gets only the application from which it is executed.
    Is there something like "GetNext"?

    Thanks

    "Tom Ogilvy" wrote:

    > set o = GetObject(,"Excel.Application")
    > ? o.Caption
    > Microsoft Excel
    >
    >
    > Assuming you don't have multiple instances of Excel open except the one you
    > are trying to get and the instance in the web page. I would assume the
    > instance in the web page would not be detected by GetObject, but I haven't
    > test it.
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    >
    > "Łukasz Szczepański" wrote:
    >
    > > Yes, but I failed. I have no idea what arguments should I use
    > >
    > > GetObject([pathname] [, class])
    > >
    > > A new workbook is not saved at the stage I would like to access it, and file
    > > name is random (but hopefully with the same prefix).
    > >
    > > Thanks,
    > >
    > > Lukasz
    > >
    > > "Tom Ogilvy" wrote:
    > >
    > > > have you tried to use GetObject. See excel vba help for details.
    > > >
    > > > --
    > > > Regards,
    > > > Tom Ogilvy
    > > >
    > > >
    > > > "Łukasz Szczepański" wrote:
    > > >
    > > > > Hi,
    > > > >
    > > > > I would like to copy some data to my spreadsheet from workbook which is
    > > > > opened from web. The problem is that "Export to Excel" button always opens
    > > > > new Excel application, so I can't reference to new workbook from VBA.
    > > > >
    > > > > How can I check other running applications and how to copy data from other
    > > > > Excel application to my workbook?
    > > > >
    > > > > Thanks in advance,


  6. #6
    Tom Ogilvy
    Guest

    RE: How to reference to other Excel application in VBA

    No, there really isn't any latitude or control if you don't know the document
    name.

    --
    Regards,
    Tom Ogilvy


    "Łukasz Szczepański" wrote:

    > Unfurtunately it gets only the application from which it is executed.
    > Is there something like "GetNext"?
    >
    > Thanks
    >
    > "Tom Ogilvy" wrote:
    >
    > > set o = GetObject(,"Excel.Application")
    > > ? o.Caption
    > > Microsoft Excel
    > >
    > >
    > > Assuming you don't have multiple instances of Excel open except the one you
    > > are trying to get and the instance in the web page. I would assume the
    > > instance in the web page would not be detected by GetObject, but I haven't
    > > test it.
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > >
    > >
    > > "Łukasz Szczepański" wrote:
    > >
    > > > Yes, but I failed. I have no idea what arguments should I use
    > > >
    > > > GetObject([pathname] [, class])
    > > >
    > > > A new workbook is not saved at the stage I would like to access it, and file
    > > > name is random (but hopefully with the same prefix).
    > > >
    > > > Thanks,
    > > >
    > > > Lukasz
    > > >
    > > > "Tom Ogilvy" wrote:
    > > >
    > > > > have you tried to use GetObject. See excel vba help for details.
    > > > >
    > > > > --
    > > > > Regards,
    > > > > Tom Ogilvy
    > > > >
    > > > >
    > > > > "Łukasz Szczepański" wrote:
    > > > >
    > > > > > Hi,
    > > > > >
    > > > > > I would like to copy some data to my spreadsheet from workbook which is
    > > > > > opened from web. The problem is that "Export to Excel" button always opens
    > > > > > new Excel application, so I can't reference to new workbook from VBA.
    > > > > >
    > > > > > How can I check other running applications and how to copy data from other
    > > > > > Excel application to my workbook?
    > > > > >
    > > > > > Thanks in advance,


  7. #7
    Travich
    Guest

    Re: How to reference to other Excel application in VBA

    I am having the same problem. The problem is that the get object
    actually access the workbook, but I can't "activate" the workbook. I
    get an error 50290 when I try to do so. Also, in the watch window, the
    workbook never appears under application. How do I get it to appear
    under there? I mean, the work book is already open, so I can't "open
    it" again. This is very frustrating.

    A little background, I'm simply trying to have a buttom that says
    "populate report." A new report in a NEW instance of the Excel
    Application opens and the report is populated in this window. The
    problem is that I can get the workbook, but I can't programmatically do
    things like "activate" and that's driving me nuts... Glad to hear any
    suggestions.


+ 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