Hi, I consider myself a newbie to vbscript. Been working with VBA for a bit
however. I'm trying to see if I can interact with applications using event
based code. An example of such is:
'Snip******************************
Option Explicit
Dim objExcel
Dim i
Set objExcel = CreateObject("Excel.Application")
WScript.ConnectObject objExcel,"objExcel_"
objExcel.Visible = True
objExcel.Workbooks.Add
i = 0
Do
WScript.Sleep(100)
i = i + 1
Loop While (i < 100)
WScript.Echo("Script Complete")
Sub objExcel_WindowActivate()
WScript.Echo("WindowActivate")
End Sub
'Snip******************************
I tried referencing some of the articles in the library, but I think I wound
up confusing myself. The above code just returns an error that it can not
connect to the object. If I use WScript.CreateObject("Excel.Application",
"objExcel_") instead, it compiles, but does not respond to events. Any
pointers for a newbie?
-J