Click here to Skip to main content
15,887,333 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I created an object for
C#
Microsoft.Office.Interop.Excel.Workbook xlBook;

by using this Object, I called the method
C#
xlBook.Open(path,missing....);

when this open method gets called, it creates one excel.exe listing in the task manager.

My task is, I need to get the process Id when excel.exe is created


Thanks In Advance.

Naruto....


[original title]
How to get the Current created process Id,Name when call Microsoft.Office.Interop.Excel.Workbook xlBook.Open(..) method
Posted
Updated 29-Sep-11 0:06am
v3
Comments
Slacker007 29-Sep-11 6:07am    
Edit: shortened title, added tag, formatted code.

Excel application has interesting property: Hwnd[^], which returns a number indicating the top-level window handle of the Microsoft Excel window.
When you catch the handle to Excel application, you can use Process.GetProcessById()[^] to Excel application.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900