Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
Description

Excerpt

Passes a spreadsheet from ExcelApplication to ExcelTemplate.

Signature
C#C#
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}
{signature:vb.net
vb.net
}
Public Overridable Sub Open(ByVal excelApplication As ExcelApplication, ByVal workbook As Workbook)
Parameters

...

The instance of ExcelApplication that was used to create the spreadsheet.

...

A Workbook object representing the Excel file created with ExcelApplication.

Exceptions

...

Open will throw this exception if null (C#) or Nothing (VB.NET) is passed to the method.

...

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.

{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}
Example
Code Block
csharpcsharp
titleC#
Code Block
vb.nettitle