I need to open an excel file xlsx to remove the commas from a pair of tables so that I can convert the file to .csv . I want to know if I can do this with a NumberFormat or something similar? I'm starting from row 15, that's where the information starts to unfold
Up to this point I can change the cell formats, but I can not make them stay in the excel sheet. This is what I have:
Application excel = new Application();
Workbook sheet = excel.Workbooks.Open(filePatht);
Worksheet x = excel.ActiveSheet as Worksheet;
_Worksheet xlWorksheet = sheet.Sheets[1];
Excel.Range xlRange = xlWorksheet.UsedRange;
int rowCount = xlRange.Rows.Count;
for (int ix = 15; ix < rowCount; ix++) {
var x18 = xlRange.Cells[ix, 8].Text;
var x19 = xlRange.Cells[ix, 9].Text;
xlRange.Cells[ix, 8].NumberFormat = "0.00";
xlRange.Cells[ix, 9].NumberFormat = "0.00";
}
sheet.Close(true);
excel.Quit();
System.Runtime.InteropServices.Marshal.ReleaseComObject(x);
System.Runtime.InteropServices.Marshal.ReleaseComObject(sheet);
System.Runtime.InteropServices.Marshal.ReleaseComObject(excel);