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

...

Description

Excerpt

Passes a spreadsheet from ExcelApplication to ExcelTemplate.

Signature
C#
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)
{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#}
Parameters
Param
excelApplication
excelApplication

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

Param
workbook
workbook

A Workbook object representing the Excel file created with ExcelApplication.

Exceptions
Exception
ArgumentNullException
ArgumentNullException

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

Exception
ArgumentException
ArgumentException

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.

Example
Code Block
csharp
csharp
titleC#


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


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