views:

35

answers:

1

hi can you help me to find the problem at this line of my code where i try to add canvas to excel sheet from c#

 Line 1   Excel.Worksheet ws = 
                (Excel.Worksheet) Globals.ThisAddIn.GetActiveWorksheet();
 Line 2   ws.Shapes.AddCanvas(100,100,100,100);

at line 2 it gives me exception... am i doing smth wrong? thanks a lot!

A: 

See this - http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.shapes.addcanvas.aspx

It says "This method supports the .NET Framework infrastructure and is not intended to be used directly from your code"

shahkalpesh