Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

Referencing a specific Excel Session by PID

Posted on 2004-08-05
8
Medium Priority
?
151 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
8 Comments
 
LVL 11

Accepted Solution

by:
ajaikumarr earned 800 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

648 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