Skip to main content
insightsoftware Documentation insightsoftware Documentation
{%article.title%}
Published:
Was this article helpful?
0 out of 0 found this helpful

SymbolQuery Class

The SymbolQuery class represents a symbol query that is built from the menu option: Symbol Query. The functions and properties of this class can be used to build a new symbol query, modify an existing symbol query and output the results to a worksheet.

Property Summary

  • Property SymbolOutput As SymbolOutput

Sub/Function Summary

  • Sub AddSymbolSpec(symbolSpec As String, [root As String])
  • Sub ClearSpecs()
  • Sub LoadQuery(fileName As String)
  • Sub RunToWorksheet([worksheetName As String], [cell As String])

Properties

Parameter

Description

SymbolOutput

Property SymbolOutput As SymbolOutput

Specifies whether the query results include symbol name, symbol description or both. 

  • SymbolOutput_Name – Query results display symbol name. This is the default.
  • SymbolOutput_Description – Query results display symbol description SymbolOutput_NameAndDescription - Query results display both name and description.

Subs/Functions

Parameter

Description

AddSymbolSpec

Sub AddSymbolSpec(symbolSpec As String, [root As String])

Adds a symbol spec representing the hierarchy you wish to query.

  • Parameters:
    • symbolSpec – String representing a single symbol spec. For example: TRIALBAL#99.
    • root – Optional string representing the root symbol name for the specified symbol.
  • Errors:

    ErrorCode.INVALID_PARAMETER – This error is thrown when the symbol spec is invalid or when the root is not a valid root for the specified symbol.

ClearSpecs

Sub ClearSpecs()

Removes all symbol specs that have been added or loaded in the SymbolQuery.

LoadQuery

Sub LoadQuery(fileName As String)

Loads a query spec that has been previously built and saved from the menu option: Symbol Query

  • Parameters:

    filename  – String representing the full path to the query file to load. For example: C:\SymbolQuery.lvqsq.

  • Errors:

    ErrorCode.INVALID_PARAMETER – This error is thrown when the file cannot be loaded.

RunToWorksheet

Sub RunToWorksheet([worksheetName As String], [cell As String])

Runs a symbol query and places the results into the specified worksheet and cell location.

  • Parameters:
    • worksheetName  – Optional string representing the name of the worksheet to place the results.  If the worksheet does not exist, it will be created.  If the worksheetName parameter is not specified, the current worksheet will be used.
    • cell – Optional string representing the cell location to begin the symbol query. If the cell parameter is not specified, the default cell location A1 will be used.
  • Errors:

    ErrorCode.INVALID_PARAMETER – This error is thrown when the query is invalid or when the specified worksheet name or cell are invalid.

Sample Usage

Sub RunSymbolQuery()

On Error GoTo ErrorHandler

Dim query As Longview.SymbolQuery

Set query = New Longview.SymbolQuery

query.LoadQuery “C:\MySymbolQuery.lvqdq”

query.SymbolOutput = SymbolOutput_Name

query.RunToWorksheet “MySymbolQuery”, “B1”

 

ErrorHandler:

If Err.Number <> 0 Then

MsgBox “Unable to run Symbol Query (“ & Err.Number & “) – “ & Err.Description

End If

 

End Sub 

Published:

SymbolQuery Class

The SymbolQuery class represents a symbol query that is built from the menu option: Symbol Query. The functions and properties of this class can be used to build a new symbol query, modify an existing symbol query and output the results to a worksheet.

Property Summary

  • Property SymbolOutput As SymbolOutput

Sub/Function Summary

  • Sub AddSymbolSpec(symbolSpec As String, [root As String])
  • Sub ClearSpecs()
  • Sub LoadQuery(fileName As String)
  • Sub RunToWorksheet([worksheetName As String], [cell As String])

Properties

Parameter

Description

SymbolOutput

Property SymbolOutput As SymbolOutput

Specifies whether the query results include symbol name, symbol description or both. 

  • SymbolOutput_Name – Query results display symbol name. This is the default.
  • SymbolOutput_Description – Query results display symbol description SymbolOutput_NameAndDescription - Query results display both name and description.

Subs/Functions

Parameter

Description

AddSymbolSpec

Sub AddSymbolSpec(symbolSpec As String, [root As String])

Adds a symbol spec representing the hierarchy you wish to query.

  • Parameters:
    • symbolSpec – String representing a single symbol spec. For example: TRIALBAL#99.
    • root – Optional string representing the root symbol name for the specified symbol.
  • Errors:

    ErrorCode.INVALID_PARAMETER – This error is thrown when the symbol spec is invalid or when the root is not a valid root for the specified symbol.

ClearSpecs

Sub ClearSpecs()

Removes all symbol specs that have been added or loaded in the SymbolQuery.

LoadQuery

Sub LoadQuery(fileName As String)

Loads a query spec that has been previously built and saved from the menu option: Symbol Query

  • Parameters:

    filename  – String representing the full path to the query file to load. For example: C:\SymbolQuery.lvqsq.

  • Errors:

    ErrorCode.INVALID_PARAMETER – This error is thrown when the file cannot be loaded.

RunToWorksheet

Sub RunToWorksheet([worksheetName As String], [cell As String])

Runs a symbol query and places the results into the specified worksheet and cell location.

  • Parameters:
    • worksheetName  – Optional string representing the name of the worksheet to place the results.  If the worksheet does not exist, it will be created.  If the worksheetName parameter is not specified, the current worksheet will be used.
    • cell – Optional string representing the cell location to begin the symbol query. If the cell parameter is not specified, the default cell location A1 will be used.
  • Errors:

    ErrorCode.INVALID_PARAMETER – This error is thrown when the query is invalid or when the specified worksheet name or cell are invalid.

Sample Usage

Sub RunSymbolQuery()

On Error GoTo ErrorHandler

Dim query As Longview.SymbolQuery

Set query = New Longview.SymbolQuery

query.LoadQuery “C:\MySymbolQuery.lvqdq”

query.SymbolOutput = SymbolOutput_Name

query.RunToWorksheet “MySymbolQuery”, “B1”

 

ErrorHandler:

If Err.Number <> 0 Then

MsgBox “Unable to run Symbol Query (“ & Err.Number & “) – “ & Err.Description

End If

 

End Sub 

For an optimal Community experience, Please view on Desktop