Link to home
Start Free TrialLog in
Avatar of Peter Chan
Peter ChanFlag for Hong Kong

asked on

Problem to error

Hi,
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)

Open in new window

which line should be with the error? How to further find out reason to such error?
Avatar of Pawan Kumar
Pawan Kumar
Flag of India image

Hi
Pls try..

You are using OPENXML then file format should be xlsx.

Hope it helps!
Avatar of Peter Chan

ASKER

I mean the way to locate the reason, within C# codes.
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi,
Pls post the code from this function -

ReadFile(String par_File)

Hope it helps!