Previous Page | Next Page

Controlling SAS from Another Application Using OLE

QueryWindow Method



Queries whether a specified window exists within the SAS session.
Syntax
Details
Example

Syntax

QueryWindow("window-name")


Details

QueryWindow returns either True or False based on whether the specified window is open in the automated SAS session. If the window exists but is not visible, QueryWindow still returns True.

The window name that you specify must match the exact spelling of the window name in SAS. The window-name argument is not case sensitive.


Example

This Visual Basic code gets an existing SAS session and checks whether the BUILD window is open. If the window is not open, this code invokes BUILD:

Dim OleSAS as Object
Set OleSAS = GetObject(,"SAS.Application")
If (Not OleSAS.QueryWindow("build")) Then
   OleSAS.Command("build")
EndIf

Previous Page | Next Page | Top of Page