Message-ID: <1965832840.7835.1711623301741.JavaMail.web05$@web05> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_7834_1544000163.1711623301741" ------=_Part_7834_1544000163.1711623301741 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html Switching from XLS to XLSX or XLSM

Switching from XLS to XLSX or XLSM

In ExcelWriter 8, support for the new Open Office XML (OOXML) file = formats (XLSX, XLSM) was introduced in ExcelApplication. Since XLSX files h= ave different file format defaults and a different file structure than XLS,= ExcelWriter's behavior can change between the two file formats in specific= situations. These differences are outlined below.


Using the Color Pal= ette

XLS files use a 56 color palette (see Excel's Color Palette Explained). When using ExcelApplication's = Workbook.Palette= , ExcelWriter will throw an error if Palette.GetColor is called on an XLS file and the colo= r doesn't exist in the palette. Customers are encouraged to use Palette.GetClosestColor to avoid calling for colors that don't exist in the palette. ExcelWrite= r will approximate which color from the 56 color palette to use.

In XLSX files, there are an unlimited number of colors available. = Palette.GetClosestColor will return the exact color, rather than an approximation= based on the 56-color palette. Customers may need to adjust the colors to = retain the original look and feel of the workbook.

Note: XLSX files also have an underlying 56-color palet= te for the purposes of rendering XLSX files in Excel 2003 (with compatibili= ty pack). This palette can still be modified by ExcelApplication v8. See this post for information on designing Excel 2007/2010 reports th= at might be viewed in Excel 2003.

Creating F= iles from Scratch

ExcelApplication can generate a spreadsheet either by opening an existin= g file with ExcelAppli= cation.Open or by creating a new file in memory using ExcelApplication.Create(FileForma= t). Starting in v8, ExcelWriter can create both XLS and XLSX files, but= the file format must be specified when calling Create.

=20
//Specify either FileFormat.Xlsx or FileFormat.Xls to create a f=
ile
Workbook wb =3D ExcelApplication.Create(ExcelApplication.FileFormat.Xlsx);
=20

The Create method uses an= underlying template with defaults associated with the file format. XLS fil= es use the defaults from Excel 2003; XLSX files use the defaults from Excel= 2007. Switching to XLSX means the default template will change and the new= defaults may change how output files look.

The largest impact from this relates to named styles. In Excel 2003, the= default Normal style is Arial, size 10. In Excel 2007, the default Normal = style is Calibri, size 11. Settings that are based on the Normal style will= be different between XLS and XLSX files:

To ensure that output remains consistent while switching to XLSX, we rec= ommend creating a blank XLSX file in Excel that has any desired defaults se= t, such as the Normal style. Then call ExcelApplication.Open on the Excel file, rather= than calling Create.

Chart defaults

Some very minor charting defaults have changed, such as:

The workaround is to set these properties to the desired values in Excel= Writer code. Most ExcelWriter-generated charts will appear the same regardl= ess of whether they are in XLS or XLSX files.

New Excel features=

New features were introduced in Excel 2007 and 2010. ExcelWriter does no= t currently support all the new features that are available in 2007/2010. W= e are constantly working to incorporate support for these features in futur= e releases of OfficeWriter.

ExcelWriter can largely manipulate elements in XLS files without having = to completely parse them, which includes features that were introduced in E= xcel 2007/2010. For example, Office introduced a series of new formulas (e.= g. RANDBETWEEN, NORMAL.DIST). These formulas are mostly ignored by ExcelWri= ter in XLS files.

XLSX files are parsed much more thoroughly and ExcelWriter will sometime= s throw exceptions if it encounters features that have not been implemented= . In the case of new 2007/2010 formulas in XLSX files, ExcelWriter will thr= ow a 'cannot find function in table' exception if support for the = new formula hasn't been added yet.

We are adding support for new features, including formulas, with every r= elease. Customers are encouraged to upgrade to th= e latest version of OfficeWriter for the most recent features and to contact support if upgrading doesn't resol= ve the issue.

------=_Part_7834_1544000163.1711623301741--