5
Answers

Error while Creating the Excel Application in Silverlight

Photo of Prasant Jinaga

Prasant Jinaga

13y
2.5k
1

Hi All,

I am Getting an error like "This operation is not supported in the current context." while Creating an object of Excel.Application in the Following Code.

excelApp = AutomationFactory.CreateObject("Excel.Application");

Can anyone help on this please why this error is coming.

Thanks,
Prasant

Answers (5)

1
Photo of Ravi Sangtani
NA 806 6k 7y
Hi! try this one
  1. bool isfound = false;  
  2. for (int i = 0; i < allstd.Length; i++)  
  3. {  
  4. isfound = false;  
  5. for (int j = 0; j < present.Length; j++)  
  6. {  
  7. if (allstd[i] == present[j])  
  8. {  
  9. isfound = true;  
  10. break;  
  11. }  
  12. }  
  13. if (!isfound)  
  14. {  
  15. MessageBox.Show(allstd[i]);  
  16. }  
  17. }