Join
Sign in
Search Options
Search Everything
Search Formats
Home
Blog
Resources
Forums
About Open XML
More ...
Home
»
Forums
»
Formats
»
WordprocessingML
»
The specified package is invalid. The main part is missing.
The specified package is invalid. The main part is missing.
Formats
Discussions about working with different Open XML Formats
Get this RSS feed
Details
3
Replies
0
Subscribers
Posted
over 2 years ago
Options
Subscribe via RSS
Share this
WordprocessingML
The specified package is invalid. The main part is missing.
rated by 0 users
This post has
3 Replies |
0
Followers
jolibal
20
Posted by
jolibal
on
Mon, Jan 18 2010 3:13 PM
rated by 0 users
Post Points: 20
The specified package is invalid. The main part is missing.
Hello !
I try open OpenXml with Open xml sdk 2.0 - but it failded.
using (WordprocessingDocument myDoc = WordprocessingDocument.Open(fileName, true)) { }
I have exception : A first chance exception of type 'DocumentFormat.OpenXml.Packaging.OpenXmlPackageException' occurred in DocumentFormat.OpenXml.dll Exception : The specified package is invalid. The main part is missing.
why ?
Everything happened correctly few months ago. But today I have some problem , maybe it is the reason of windows or microsoft standard updating?
If yes, what shoud I do?
Macilquham
185
Posted by
Macilquham
on
Mon, Feb 1 2010 9:46 PM
rated by 0 users
Post Points: 20
Re: The specified package is invalid. The main part is missing.
Hi Jolibal,
What is the document you are trying to open? Try opening this in word and see if you get the same issue.
Thanks
Jay
tggagne
20
Posted by
tggagne
on
Sat, Feb 6 2010 1:30 PM
rated by 0 users
Post Points: 20
Re: The specified package is invalid. The main part is missing.
I'm having the same problem. I created a spreadsheet in Excel, saved as ODS, but when I try reading it I get the error above. I tried looking at the file but it must be compressed 'cause it's mostly binary. Excel's File Properties confirms the file is OpenDocument Spreadsheet format.
The code I used to try opening it (with 2.0 SDK) is:
[TestMethod]
public void LoadSaveTest()
{
var simpleFilePath = // the file's path
var outputFilePath = // an output file path
if (!File.Exists(simpleFilePath))
throw new FileNotFoundException(simpleFilePath);
var aSheet = SpreadsheetDocument.Open(simpleFilePath, false);
}
What I want for a test is to simply open the ODS and save it under another name. After fixing the exception (thrown on the Open()) I need to figure out how to save it.
zeyadrajabi
385
Posted by
zeyadrajabi
on
Thu, Feb 18 2010 1:19 PM
rated by 0 users
Post Points: 5
Re: The specified package is invalid. The main part is missing.
The Open XML SDK is not able to open ODF formats, such as ODS or ODT.
Page 1 of 1 (4 items)