Forums     Knowledge Base     OfficeWriter Online     
 
 
This documentation is for
OfficeWriter v3.7.1
ASP/COM Platform

View Docs for Another
Version or Platform

Programmer's Reference > ExcelApplication > Methods > Open

ExcelApplication is not
available in ExcelWriterSE.

Open Method

Open(FileName, ReadOnly)
Opens an existing spreadsheet.
Open(Stream)
Opens an existing spreadsheet from a System.IO.Stream (.NET), an IStream (ASP), or a ByteArray (ASP) .

Open(FileName, ReadOnly)

Syntax:

[VBScript]
Sub Open(FileName As String, [aReadOnly As Boolean = False])

Description:

Opens an existing spreadsheet. The Open method allows you to use preset spreadsheet formats. For example, you could create an order form spreadsheet that includes headings for item, quantity, price, billing information, etc. Then, to generate an order, you would open the spreadsheet, assign specific values to the appropriate cells, and save the file with a new file name.

Open takes two parameters:

FileName Path and file name of the spreadsheet to open.
ReadOnly When set to True, the opened spreadsheet can be read but not modified. That is, you cannot call the Save method later, even if you rename the file. Default value:
False

Example:

[VBScript]
Dim objExcelApp As SAExcelApplication
Set objExcelApp = CreateObject("SoftArtisans.ExcelWriter")
objExcelApp.Open "c:\XLWFormats\order.xls", True
...
'--- Assign values to cells
...
objExcelApp.Save "c:\orders\order00275.xls"
Set objExcelApp = Nothing

Open(Stream)

Syntax:

[VBScript]
Public Sub Open(Stream As IStream/ByteArray)

Description:

Opens an existing spreadsheet. The Open method allows you to use preset spreadsheet formats. For example, you could create an order form spreadsheet that includes headings for item, quantity, price, billing information, etc. Then, to generate an order, you would open the spreadsheet, assign specific values to the appropriate cells, and save the file with a new file name.

Parameter:

  • Stream
    In .NET: A System.IO.Stream object, or a class derived from System.IO.Stream (for example, System.IO.FileStream). In ASP: In IStream or a ByteArray.

Example:

[VBScript]
Set app = Server.CreateObject("Softartisans.ExcelWriter")
app.OpenStream byteArray

or

Set app = Server.CreateObject("Softartisans.ExcelWriter")
app.OpenStream IStream



Copyright 2006 © SoftArtisans, Inc. All Rights Reserved.