Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Wiki Markup
{description}
{excerpt}Passes a spreadsheet from [ExcelApplication|ExcelApplication] to [ExcelTemplate|ExcelTemplate]. 
{excerpt}
{signature:C#}
 public virtual void Open(ExcelApplication excelApplication, Workbook workbook)
{signature}
{signature:vb.net}
Public Overridable Sub Open(ByVal excelApplication As ExcelApplication, ByVal workbook As Workbook)
{signature}
{parameters}
{param:excelApplication}The instance of {{ExcelApplication}} that was used to create the spreadsheet.
{param}
{param:workbook}A [Workbook|Workbook] object representing the Excel file created with {{ExcelApplication}}.
{param}
{exceptions}
{exception:ArgumentNullException}[Open|ExcelTemplate.Open] will throw this exception if {{null}} \(C\#\) or {{Nothing}} \(VB.NET\) is passed to the method.
{exception}
{exception:ArgumentException}
{exception}
{remarks}
You can use {{ExcelApplication}} to create a document with data markers \(a template\) and pass the file to {{ExcelTemplate}} to populate the data markers.

If your template file is the new Office Open XML \(.xlsx\) format, you cannot open it using {{ExcelApplication}} in ExcelWriter version 7.

{remarks}
{example}{code:csharp|title=C#}

          ExcelApplication xla = new ExcelApplication();
          Workbook wb = xla.Create();
          ExcelTemplate xlt = new ExcelTemplate();
          xlt.Open(xla, wb);
        {code}
{code:vb.net|title=vb.net}

          Dim xla As New ExcelApplication()
          Dim wb As Workbook = xla.Create()
          Dim xlt As New ExcelTemplate()
          xlt.Open(xla, wb)
        {code}

{example}