varon89
January 29th, 2008, 07:09 PM
In the code below, there's some problem with the last line. When I construct the Excel.Application, most of its fields, when viewed from Watch, say that "an exception of type 'System.Runtime.InteropServices.COMException'" has been thrown. Anything that I do with exApp after that throws an error and halts the program.
Excel.Application exApp;
Excel.Workbooks workbooks;
Excel.Sheets sheets;
Excel._Worksheet sheet;
Excel.Range range;
numSelectedContacts = myDGV1.SelectedRows.Count;
// start excel
exApp = new Excel.Application();
Excel.Application exApp;
Excel.Workbooks workbooks;
Excel.Sheets sheets;
Excel._Worksheet sheet;
Excel.Range range;
numSelectedContacts = myDGV1.SelectedRows.Count;
// start excel
exApp = new Excel.Application();