WksDocument Object
The WksDocument object represents a worksheet document. WksDocument objects are created by the Documents.Add or Documents.Open methods. Cells within a worksheet are accessed through the Cells, Rows, and Columns methods. The active cell and current selection are accessed through a WksWindow object. You can perform a mathematical transformation on worksheet cells and merge files together with the WksDocument object. The WksRange object can be accessed using the Cells, Rows, Columns, and UsedRange properties.
Derived from: Document object (All methods and properties of Document apply to this object.)
The following table provides the properties of the WksDocument object:
Property |
Description |
Returns/sets the default column width for the worksheet. |
|
Returns the default Format object for the worksheet. It is a read only property. |
|
Returns/sets the default row height for the worksheet. |
|
Returns the PageSetup object for the worksheet. It is a read only property. |
|
Returns a Range object which encompasses all the used cells in the worksheet. It is a read-only property. |
The following table provides the methods of the WksDocument object:
Method |
Description |
Sets worksheet coordinate columns. |
|
Returns a Range object containing one or more cells. This is the same as the Range method below. |
|
Returns a Range object containing one or more entire columns of cells. |
|
Combines a worksheet file with the current document. |
|
Prints the worksheet. |
|
Applies coordinate system projection to columns. |
|
Returns a Range object containing one or more cells. This is the same as the Cells method above. |
|
Returns a Range object containing one or more entire rows of cells. |
|
Filters data spatially. |
|
Applies a mathematical transform equation to columns. Use Transform3 to apply a mathematical transform equation to columns, rows, or cells. |
|
Applies a mathematical transform equation to columns, rows, or cells. Use Transform3 to apply the transform differently for text, numbers, and blank cells. |
|
Applies a mathematical transform equation to columns, rows, or cells. Allows transforms to be applied to text, numbers, and blank cells differently. |
|
Loads a database into the current document. |
Example
The following script demonstrates how the WksDocument object is used in reference to the Documents collection.
Sub Main
'Declares SurferApp as an object
Dim SurferApp As Object
'Creates an instance of the Surfer Application object and assigns it
'to the variable named "SurferApp"
Set SurferApp = CreateObject("Surfer.Application")
'Makes Surfer visible
SurferApp.Visible = True
'Declares Wks as an object
Dim Wks As Object
'Creates a worksheet document in Surfer and assigns it to the variable
'named "Wks"
Set Wks = SurferApp.Documents.Add(srfDocWks)
End Sub