Peter Chan
asked on
Problem to error
Hi,
To this Stacktrace
To this Stacktrace
Exception: The specified package is invalid. The main part is missing. at DocumentFormat.OpenXml.Packaging.OpenXmlPackage.Load()
at DocumentFormat.OpenXml.Packaging.OpenXmlPackage.OpenCore(String path, Boolean readWriteMode)
at DocumentFormat.OpenXml.Packaging.SpreadsheetDocument.Open(String path, Boolean isEditable, OpenSettings openSettings)
at DocumentFormat.OpenXml.Packaging.SpreadsheetDocument.Open(String path, Boolean isEditable)
at App12.Program.ReadFile(String par_File)
which line should be with the error? How to further find out reason to such error?
ASKER
I mean the way to locate the reason, within C# codes.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi,
Pls post the code from this function -
ReadFile(String par_File)
Hope it helps!
Pls post the code from this function -
ReadFile(String par_File)
Hope it helps!
Pls try..
You are using OPENXML then file format should be xlsx.
Hope it helps!