Solved

Referencing a specific Excel Session by PID

Posted on 2004-08-05
8
145 Views
Last Modified: 2010-05-02
If I have two or more Excel sessions running, how do I set a variable object reference to a specific Excel session? Using the Process ID of an Excel session is preferable.

Thanks in advance.
0
Comment
Question by:cartti
  • 3
8 Comments
 
LVL 11

Accepted Solution

by:
ajaikumarr earned 200 total points
ID: 11725404
0
 
LVL 11

Expert Comment

by:ajaikumarr
ID: 11725427
0
 
LVL 7

Expert Comment

by:_agj_
ID: 11725900
if u have yourself opened the excel sessions from code, u shud have handles to them.

psapi is the option if u want to get the process id and do stuff..

state ur req. more clearly...there might be an easier way out.
0
 
LVL 2

Author Comment

by:cartti
ID: 11725929
Sorry if my question was unclear. I would like to get a specific object reference of one of the Excel sessions (perhaps by the PID) through a Visual Basic application. e.g. GetObject() is not sufficient as it gets the first instance of Excel that was created.
0
 
LVL 11

Expert Comment

by:ajaikumarr
ID: 12398674
Hai,

My 1st link has the same code which he requested...

Bye
Ajai
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question