I want to Export Data from an DataTable to an Excel sheet. I use this to enable the Hyperlinks:
oWB.SaveAs(path + "newsletter.xls", Microsoft.Office.Interop.Excel.XlFileFormat.xlWorkbookNormal, System.Reflection.Missing.Value, System.Reflection.Missing.Value, System.Reflection.Missing.Value, System.Reflection.Missing.Value, Microsoft.Office.Interop.Excel.XlSaveAsAccessMode.xlNoChange, System.Reflection.Missing.Value, System.Reflection.Missing.Value, System.Reflection.Missing.Value, System.Reflection.Missing.Value, System.Reflection.Missing.Value);
the xlWorkbookNormal is the only way to enable the Hyperlink, with all other the Hyperlink will not be displayed. But the Problem with that is that because of that my Formatting stuff dosent work, It only work with xlWorkbookDefault.
How can I display this Formatting style on the normal xlWorkbookNormal:
oXL.DisplayAlerts = false;
oWS.Name = "GEKKO Computer GmbH";
oWS.Cells.Borders.LineStyle = Microsoft.Office.Interop.Excel.XlLineStyle.xlLineStyleNone;
exrngKopf.EntireRow.Font.Bold = true;
What I have tried:
I tried something like that:
int i = 0;
foreach (Microsoft.Office.Interop.Excel.Range c in range.Cells)
{
string tmp = (c.Value as string);
c.Value = string.Empty;
c.Value2 = string.Empty;
c.FormulaLocal = tmp;
i++;
if (i == 10 || i == 100 || i == 1000 || i == 10000)
{
string muell = string.Empty + tmp;
}
}