Please guide me how could i convert xlsb file to xlsx?
i used this code but did not worked.
private string ConvertXlsbToXlsx(string filepath)
{
string strfile = "";
Excel.Application excelApplication = new Excel.Application();
try
{
Excel.Workbook workbook = excelApplication.Workbooks.Open(filepath);
workbook.SaveAs(filepath.Replace(".xlsb",".xlsx"), XlFileFormat.xlExcel12, Type.Missing, Type.Missing, Type.Missing, Type.Missing, XlSaveAsAccessMode.xlExclusive,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
workbook.Close(false, Type.Missing, Type.Missing);
workbook = null;
}
catch(Exception ex)
{
Logger.Write("Erro from excel convertion " + ex.Message, Logger.MsgType.Error);
}
finally
{
excelApplication.Quit();
excelApplication = null;
}
return strfile;
}
please help me with sample code. thanks