Page tree

Versions Compared

Key

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

Excerpt

Opens a Workbook from an ExcelTemplate object.

Signature
C#C#
Wiki Markup
{description}
{excerpt}Opens a [Workbook|Workbook] from an [ExcelTemplate|ExcelTemplate] object.{excerpt}
{signature:C#}
 public virtual Workbook Open(ExcelTemplate excelTemplate)
Signature
{signature}{signature:vb.net
vb.net
}
Public Overridable Function Open(ByVal excelTemplate As ExcelTemplate) As Workbook
Parameters

...

An ExcelTemplate object representing the workbook to open.

Returns

Workbook that is opened.

Remarks

If your template file is the new Office Open XML (.xlsx) format, you can pass it into the ExcelApplication.Open method just as you would a BIFF8 (.xls) Excel file. You will need to remember to give the output file a ".xlsx" extension when you call Save as ExcelWriter cannot convert .xlsx files to .xls

Exceptions
{signature}
{parameters}
{param:excelTemplate}An {{ExcelTemplate}} object representing the workbook to open.{param}
{returns}Workbook that is opened.{returns}
{remarks}
If your template file is the new Office Open XML (.xlsx) format, you can pass it into the [ExcelApplication.Open|EW8:ExcelApplication.Open(ExcelTemplate)] method just as you would a BIFF8 (.xls) Excel file. You will need to remember to give the output file a ".xlsx" extension when you call [Save |EW8:ExcelApplication.Save]as ExcelWriter cannot convert .xlsx files to .xls

{remarks}


{exceptions}
{exception:System.Exception}If there is a problem creating, opening, or writing to the  file specified, or reading from the {{Workbook}} object.{exception}
{example}{code:csharp|title=C#}

          ExcelTemplate xlt = new ExcelTemplate();

          //--- Do something with template here

          ExcelApplication xla = new ExcelApplication();
          xla.Open(xlt);
        
{code}
{code:vb.net
|title=vb.net
}

          Dim xlt As New ExcelTemplate()

          '--- Do something with template here

          Dim xla As New ExcelApplication()
          xla.Open(xlt)
        {code}

{example}
Exception
System.ExceptionSystem.Exception

If there is a problem creating, opening, or writing to the file specified, or reading from the Workbook object.

Example
Code Block
csharpcsharp
titleC#
Code Block
vb.nettitle