Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This tutorial assumes that the coder knows how to set up an Excel Template using data markers and Excel cell formatting. The .XLSX template file is available here.

ExcelTemplate vs. ExcelApplication

...

This tutorial opens an Excel file formatted as an ExcelTemplate origin file (i.e. it contains formatted data markers) using ExcelApplication object. This means that the file can be copied based upon the user's specification using the ExcelApplication CopySheet method. This method copies a worksheet (including its formatted data markers) to another location in the workbook. The method has three parameters: a

  1. A Worksheet

...

  1.  object representing the sheet to be copied

...

  1. ,
  2. An integer representing the new worksheet's position

...

  1. and,
  2. The string representing the name of the new worksheet.

Setting up the template

The template file should look something like this:

Image Added

One advanced data marker format has been used in the above template. The data marker entitled Sales Summary - %%=Header.FiscalYear references another cell for the content. The below image is the data marker that was input and is how ExcelWriter will identify the appropriate fields to bind data.

Image Added

Cell N1 was hidden by using a custom format where the field was filled with ';;;'.

Info

The template is available here.