hi how to avoid the error for Excel.application in export data to excel

Posted by Venky.Net under Silverlight on 7/19/2012 | Points: 10 | Views : 1161 | Status : [Member] | Replies : 0
this is my coding showing the error for the operation is not supported


dynamic excel = AutomationFactory.CreateObject("Excel.Application");
excel.Visible = true;

dynamic workbook = excel.workbooks;
workbook.Add();

dynamic sheet = excel.ActiveSheet;
dynamic cell = null;
int i = 1;





//Populate the excel sheet
foreach (var item in (LayoutRoot.DataContext as Bookmarks).Sites)
{
cell = sheet.Cells[i, 1];
cell.Value = item.Title;

cell = sheet.Cells[i, 2];
cell.Value = item.Uri;
cell.ColumnWidth = 100;

i++;
}




Responses

(No response found.)

Login to post response