Results 1 to 4 of 4
  1. #1
    Lounger
    Join Date
    Dec 2002
    Posts
    25
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Connect to specific instance of Access from Excel (Excel 97 SR-2)

    We have an Access 97 application for which we are using a complex Excel workbook as the edit mechanism (for a variety of sufficiently important reasons). When it comes time to pass the data back from Excel to Access, we have yet to find a way to be sure that we are sending the data to the particular Access app that invoked the Excel front-end.

    The automation command we are using within Excel to connect to Access is: Set objAccessApp = Access.Application. If there happens to be more than one copy of Access open, how do we instruct Excel to connect to the copy that invoked it?

    Harvey P. Morgan
    Schlumberger

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Connect to specific instance of Access from Excel (Excel 97 SR-2)

    I guess you could test for the name of the database that is open in the instance?

    MsgBox objaccessapp.CurrentDb.Name
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  3. #3
    Lounger
    Join Date
    Dec 2002
    Posts
    25
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Connect to specific instance of Access from Excel (Excel 97 SR-2)

    Jan,

    Thanks for your response. I'm sorry to be so slow responding to your post. No excuse, other than I overlooked it my Inbox.

    We can of course test to see if we have found the instance we want. The problem is that, if we don't have the the instance we want, we can't figure out how to tell Excel to switch to another instance of Access.

    Harvey

  4. #4
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Connect to specific instance of Access from Excel (Excel 97 SR-2)

    I use this code to find Excel instances, maybe you can adjust it to find the Access window you need?

    Option Explicit
    '''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''
    ' Copyright
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

Posting Permissions

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