AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Funciones WLanguage / Comunicación / Funciones OLE
  • Example: Using (if possible) the existing Excel session for an OLE Automation dialog
GetActiveObject (Example)
Example: Using (if possible) the existing Excel session for an OLE Automation dialog
The following example is used to control Excel via OLE Automation. If an Excel session is already active, this session is used for the Automation dialog.
The automation object is freed at the end of the Excel session.
Excel is dynamic Automation object
// If Excel is already started, retrieve it
Excel = GetActiveObject("Excel.Application")
IF Excel = Null THEN
// Excel is not started: start
Excel = new object Automation "Excel.Application"
IF Excel = Null THEN
Error("Unable to start Excel")
RETURN
END
END
IF Excel <> Null THEN
// Control Excel
...
// Free the Excel object used
delete Excel
END
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 27/05/2022

Señalar un error o enviar una sugerencia | Ayuda local