The code does convert
the document to html, but it does all the sheets. I am trying to pull
just
one sheet, save it to a new location so it can be viewed as a stand along
html doc.
Excel.Application excelApp = new Excel.ApplicationClass();
Excel.Workbook theWorkbook = excelApp.Workbooks._Open(excelFile, false,
false, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
Excel.Sheets sheets = theWorkbook.Worksheets;
object format = Microsoft.Office.Interop.Excel.XlFileFormat.xlHtml;
String outputFile =
@"C:\SourceSafe\ConvertExcelSheetsToHTML\ReportFiles.html";
Microsoft.Office.Interop.Excel.Worksheet wsCurrent =
(Microsoft.Office.Interop.Excel.Worksheet)sheets.get_Item(52);
wsCurrent.SaveAs(outputFile, format, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing);
As you can see I am requesting sheet # 52 but it does all the sheets.