Premanshu999
New Member
- Joined
- Jun 12, 2014
- Messages
- 3
Hi
I am trying to write a VBA function which will get the handle for a specific already open IE window. I have found below code after some googling for this:-
This code works absolutely fine on my computer, however when I deploy the tool in the Citrix environment of our client I get error "ActiveX component can't create object" on the line 3:-
Can anyone please help me understand what am I doing wrong.
Thanks in advance.
Premanshu
I am trying to write a VBA function which will get the handle for a specific already open IE window. I have found below code after some googling for this:-
Code:
Public Function FindIEObject(target As String) As InternetExplorerMedium
Set objShell = CreateObject("Shell.Application")
IE_count = objShell.Windows.Count
For x = 0 To (IE_count - 1)
On Error Resume Next ' sometimes more web pages are counted than are open
my_url = objShell.Windows(x).******************
my_title = objShell.Windows(x).Document.Title
If InStr(my_title, target) > 0 Then 'compare to find if the desired web page is already open
Set FindIEObject = objShell.Windows(x)
Set myIE = objShell.Windows(x)
Exit For
End If
Next
End Function
This code works absolutely fine on my computer, however when I deploy the tool in the Citrix environment of our client I get error "ActiveX component can't create object" on the line 3:-
Code:
IE_count = objShell.Windows.Count
Can anyone please help me understand what am I doing wrong.
Thanks in advance.
Premanshu