ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Communication / OLE functions
  • Freeing
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
GetActiveObject (Function)
In french: ObjetActif
Allows to use an Automation object already started on the current computer. The application (Word or Excel for example) already started on the computer can be controlled from the WINDEV application directly.
Remark: This function avoids having to launch a new session of the application to be controlled if it has already been launched on the current workstation.
Excel is object Automation dynamic
// Si Excel est déjà lancé, utilisation de ce programme
Excel = GetActiveObject("Excel.Application")
IF Excel = Null THEN
	// On lance Excel
	Excel = new object Automation "Excel.Application"
	...
END
Syntax
<Result> = GetActiveObject(<Name of Automation server>)
<Result>: Character string
Name of the OLE automation server (if it exists) or NULL if the function failed (server not found).
<Name of Automation server>: Character string
Name of the Automation server to be found.
Remarks

Freeing

The dynamic automation object is automatically destroyed at the end of the process containing its declaration.
To explicitly free a dynamic automation object, use the following syntax:
Delete <Name of dynamic automation object>
Note The dynamic automation object is automatically released at the end of the variable's life (e.g. when the window is closed) or when the object is reallocated.
Component: wd300ole.dll
See also
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help