Show code in...     

  

 

Object Model ExcelApplication Worksheets Worksheet Cells Cell Range
Charts Chart SeriesCollection Series 3DProperties Axis ChartFrame Line Area
PivotField PivotFields PivotTable PivotTables
Style Characters Font Pictures Picture DocumentProperties PageSetup


ExcelApplication Object Reference

Open Method *

* This feature is not available in
ExcelWriterSE, ExcelWriterLE,
or ExcelWriterFree.

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

Top


Copyright © 2005, SoftArtisans, Inc.