embed oleobject in c#

M

mark doe

in vba i can embed a excel file by using

ActiveSheet.OLEObjects.Add(Filename:="C:\ExcelData\MonthlyYearlyTotalsEx.xls"
_
, Link:=False, DisplayAsIcon:=False).Select

however, in c# after making a refernce to the 9.0 excel object library
the object model is different.
I've tried it with the following

Excel.OLEObjects ol=(Excel.OLEObjects)oSheet.OLEObjects(null);

ol.Add(null,@"C:\ExcelData\MonthlyYearlyTotalsEx.xls",null,false,null,null,null,100,100,100,100);

how can i embed a file?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top