Error in save file ...
-
Hi All ! I imported an excel file in a datagridview and then Filter it by ... , then I save as it in any my computer , when want to the save in another computer , I Recieve this Error :
Old Format or Invalid Type library(Exception from HRESULT:0x80028018...
Here in my code :
...
Microsoft.Office.Interop.Excel.Application ExcelApp = new Microsoft.Office.Interop.Excel.Application();
ExcelApp.Application.Workbooks.Add(Type.Missing);
Microsoft.Office.Interop.Excel.Workbook excelBook = ExcelApp.Workbooks.Add(XlSheetType.xlWorksheet);
Microsoft.Office.Interop.Excel.Worksheet excelWorksheet = (Worksheet)(excelBook.Worksheets[1]);
excelWorksheet.DisplayRightToLeft = true;
...Thank u for any help
s_mostafa_h
-
Hi All ! I imported an excel file in a datagridview and then Filter it by ... , then I save as it in any my computer , when want to the save in another computer , I Recieve this Error :
Old Format or Invalid Type library(Exception from HRESULT:0x80028018...
Here in my code :
...
Microsoft.Office.Interop.Excel.Application ExcelApp = new Microsoft.Office.Interop.Excel.Application();
ExcelApp.Application.Workbooks.Add(Type.Missing);
Microsoft.Office.Interop.Excel.Workbook excelBook = ExcelApp.Workbooks.Add(XlSheetType.xlWorksheet);
Microsoft.Office.Interop.Excel.Worksheet excelWorksheet = (Worksheet)(excelBook.Worksheets[1]);
excelWorksheet.DisplayRightToLeft = true;
...Thank u for any help
s_mostafa_h
what is the excel version you use?? 2003 or 2007??:confused::confused:
-
what is the excel version you use?? 2003 or 2007??:confused::confused:
-
Hi All ! I imported an excel file in a datagridview and then Filter it by ... , then I save as it in any my computer , when want to the save in another computer , I Recieve this Error :
Old Format or Invalid Type library(Exception from HRESULT:0x80028018...
Here in my code :
...
Microsoft.Office.Interop.Excel.Application ExcelApp = new Microsoft.Office.Interop.Excel.Application();
ExcelApp.Application.Workbooks.Add(Type.Missing);
Microsoft.Office.Interop.Excel.Workbook excelBook = ExcelApp.Workbooks.Add(XlSheetType.xlWorksheet);
Microsoft.Office.Interop.Excel.Worksheet excelWorksheet = (Worksheet)(excelBook.Worksheets[1]);
excelWorksheet.DisplayRightToLeft = true;
...Thank u for any help
s_mostafa_h
It is possible that error is caused by different versions of Excel Interop assemblies. Anyway, you should try to avoid Excel Interop. I use GemBox.Spreadsheet .NET Excel component for generating reports in my company. Here is an example how to import/export DataGrid to Excel using GemBox.Spreadsheet.