Skip to content

After saving an Excel document an embedded object is lost and will be presented as image only #845

Description

@mcshorty

Hello,

there is the problem, that after saving an Excel document an embedded object is lost and will be presented as image only.

Precondition:

  • open new excel
  • insert - object - create from file - select a pdf file - ok
  • save excel file as myFile.xlsx

Use following code to open and save the document.
After running the code open the document in Excel again and the embedded object cannot be opened anymore and will be presented as image only.

string strFileName = "myFile.xlsx"
XSSFWorkbook rWorkbook;
using (FileStream fs = new FileStream(strFileName, FileMode.Open, FileAccess.Read))
{
	rWorkbook = new XSSFWorkbook(fs);
}
using (FileStream fs = new FileStream(strFileName, FileMode.Create, FileAccess.Write))
{
	rWorkbook.Write(fs);
}

Thank you very much
Rob

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions