Home > Net >  The abnormal from reading Excel HRESULT: 0 x800a03ec error
The abnormal from reading Excel HRESULT: 0 x800a03ec error

Time:11-14

The code is as follows:
OpenFileDialog ofd=new OpenFileDialog ();
Ofd. Filter="Excel file (*. XLS) | *. XLS";
Ofd. FilterIndex=1;
Ofd. RestoreDirectory=true;
If (ofd. ShowDialog ()==DialogResult. OK)
{
Microsoft. Office. Interop. Excel. Application myexcel=new Microsoft. Office. Interop. Excel. The Application ();
If (myexcel==null)
{
MessageBox. Show (" the file does not exist!" );
}
Myexcel. Visible=false;
Myexcel. DisplayAlerts=false;
Myexcel. AlertBeforeOverwriting=false;
. Microsoft. Office. Interop. Excel Workbooks Workbooks.=myexcel Workbooks.
. Microsoft. Office. Interop. Excel Workbook Workbook=workbooks. The Add (ofd. FileName);
. Microsoft. Office. Interop. Excel Sheets Sheets=workbook. Worksheets.
. Microsoft. Office. Interop. Excel Worksheet Worksheet=(. Microsoft. Office. Interop. Excel Worksheet) sheets. The Item [3].
Microsoft. Office. Interop. Excel. Range Range;
The range=worksheet. UsedRange;
,,,,,,,,,,
This code is to open a Excel file and read the data, in my work computer win10 system can run normally, but in the other location when a computer running Windows 7 system, when choosing to open the file, running to Microsoft. Office. Interop. Excel. The Workbook Workbook=workbooks. The Add (ofd. FileName); Popup "untreated COMException", "exception from HRESULT: 0 x800a03ec,"
A great god please help see how should solve, thank!

CodePudding user response:

Installed on the computer is a complete version of excel, digits (32/64) and your program of digits are consistent

CodePudding user response:

reference 1/f, guiyang horse Ma Shanfu plugging waterproof engineering professional maintenance of swimming pool response:
installed on the computer is a complete version of excel, digits (32/64) and your program of digits are consistent
installed WPS, as if also installed an, or from where to view the full version? How to check your program's digits?
  • Related