Completed
Last Updated: 22 Feb 2017 11:54 by ADMIN
ADMIN
Boby
Created on: 27 Oct 2016 05:44
Category: SpreadProcessing
Type: Bug Report
0
SpreadProcessing: Documents with global print area cannot be imported
Xlsx documents with global print area defined cannot be imported. Message box "The name that you entered is not valid." is shown and internally SpreadsheetNameException is thrown. 
By default, print areas are defined in the xlsx files for specific spreadsheet:
<definedName name="_xlnm.Print_Area" localSheetId="0">Sheet1!$A$1</definedName>
but this one is without localSheetId property specified.

MS Excel can import such document and even preserve the area, but do not respect it and doesn't have UI to clear it.

By OOXML specification, this attribute is optional:
<xsd:attribute name="localSheetId" type="xsd:unsignedInt" use="optional"/>

Workaround 1 (includes processing the document with MS Excel):
- Open the document in MS Excel
- Choose Formulas -> Defined names -> Named Manager
- Choose Filter -> Names with errors
- Find all Print_Area defined names and delete them
- Save the document

Workaround 2:
- Delete all print areas with OpenXML SDK


Available in LIB version: 2017.1.213
0 comments