Shell32.dll error ActiveX Component can't create object

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:-

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
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Make sure that you have all the proper refernces libraries selected.

An easy way to do this is to go on to your computer (where it works), go into the VB Editor and go to the Tools menu and select References, and note all the References that are selected.
Then, go on to the Computer where it is not working, and do the same steps. Are all the same references selected? Are any missing? If so, find them and select them (or the closest thing to them - sometimes the version numbers are slightly different if it running a different version of Office).
 
Upvote 0
Hello Premanshu,

I suspect this is a Citrix security issue because you are creating an ActiveX object on your network that is attempting to access/control Internet Explorer.
 
Upvote 0

Forum statistics

Threads
1,223,702
Messages
6,173,932
Members
452,539
Latest member
delvey

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top