I used:
excelObj =
(Excel.Application)System.Runtime.InteropServices. Marshal.GetActiveObject("Excel.Application");
but did not work. I have opened 2 excel files but excelObj.Workbooks.Count
shows zero!
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:O8**************@TK2MSFTNGP14.phx.gbl...
Adine,
You will want to use the static GetActiveObject method on the Marshal
class to do this.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Adine" <ad********@yahoo.com> wrote in message
news:s5******************************@magma.ca... User has opened an excel file and I want to take the control of the file.
In VB6 was not hard. Just I needed to use "GetObject" then I could select
the workbook. But now I don't know how to do it in C#.
Thanks