Open Method

The Open method opens an existing document. Returns a Document object.

Syntax

object.Open( filename, worksheet )

 

Parameter Type Description
filename String required, file's full path and file name including extension
worksheet Variant optional, default = ""

If filename is a GRT file type, worksheet specifies the full path and file name for worksheet or grid file.

If filename is a GRF or GPJ file type, worksheet specifies the full path and file name for the worksheet or grid file to be used instead of the saved reference or data.

If filename is a worksheet (data file), worksheet specifies the automation import options.

 

Remarks

  1. When opening templates (GRT), the worksheet parameter data file or grid file is used for all objects in the template.
  2. When opening Grapher (GRF) or project (GPJ) files, the worksheet parameter can be used to override the data or references saved in the document.
  3. When filename is a data file, the worksheet parameter consists of a series of semicolon-separated keywords. See Worksheet Import Options for details on the available Options.
  4. For example, Options contains a keyword "Sheet" for opening Excel files. Use this keyword to specify a worksheet in an Excel workbook:
    GrapherApp.Documents.Open("d:\data\multisheet.xls", "Sheet=Sheet3")

 

Example 1

This example demonstrates how to open an existing graph.

GrapherApp.Documents.Open (GrapherApp.Path + "\Samples\barchart.grf")

Example 2

This example demonstrates how to open an existing template and specify the data.

GrapherApp.Documents.Open (GrapherApp.Path + "\templates\scatter plot.grt", _

GrapherApp.Path + "\Samples\bar chart orientations.dat")

Example 3

This example demonstrates how to open a multiple sheet Excel file.

Set Wks = Grapher.Documents.Open ("d:\data\multiple sheet.xls","Sheet=Sheet1")

Example 4

This example demonstrates how to open a text file, specifying the delimiters as period and decimal separator as comma.

Set Wks = Grapher.Documents.Open ("d:\data\data.txt","Delimiter=.; DecimalSymbol=comma")

 

Used by: Documents collection