dotnet / dotnet/Open-XML-SDK

Deletion of a Part breaks reading other Parts through "using" method

Open
#1,729 12 comments 0 reactions 1 assignee Assigned to @mikeebowen View on GitHub
Dominant language
C#
Stars
4.6k
Forks
605
PR merge metrics
No merged PRs in 30d

Description

***Describe the bug**
Hello
I am upgrading from v2.20 to v.3.0.2.

The new SDK update breaks code which involves deleting/removing some Open XML Parts in my spreadsheet document.

I am applying "using" to read and write the spreadsheet document. I receive error when trying to read any Part after deletion of some other Parts, when I try to read the Part in a new "using" scope. I receive error "Specified part does not exist in the package".

Opening the spreadsheet document wit Excel or LibreOffice works perfectly fine.

**Observed behavior**
Open XML SDK perceives the spreadsheet document to be broken with error "Specified part does not exist in the package" whenever I try to read any Part, if some Parts have previously been deleted/removed with the "using" method. Excel renders the spreadsheet document without errors.

**Expected behavior**

**Desktop (please complete the following information):**
- OS: Windows 11
- Office version: Office Professional 2019
- .NET Target:
- DocumentFormat.OpenXml Version: 3.0.2

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.