Unable to load shdocvw.dll or ieframe.dll in Blue Prism

513 Views Asked by At

I am trying to use code stage to create and use Internet Explorer COM object in Blue prism, like this:

Dim ie as InternetExplorer
ie = new InternetExplorer

But when I tried to add external .dll reference, I got "Unable to load reference library" error. I tried both "shdocvw.dll" and "ieframe.dll", both failed. Can anyone give me some hints?

external reference setting

Error message

Another thought is, when we create an browser(IE) based Business Object, Blue Prism should have created an internal IE object. If we can interact with that object in code stage, that will work as well. Here is some hint to the internal IE object:

Purposely inject invalid javascript code

mshtml.ihtmlwindow2 in error message

2

There are 2 best solutions below

1
On

Easiest solution is not to use the DLLs at all and take advantage of the Visual Basic's CreateObject method. There are some drawbacks to it, but it should do for most things.

Dim ie as Object = CreateObject("InternetExplorer.Application")

enter image description here

Apparently GetObject doesn't work with IE for security reasons, so if you wanted to interact with an existing IE instance, you may need to get a bit more creative.

2
On

For external .dll reference, the .dll file should be preset under Blue Prism folder

C:\Program Files\Blue Prism Limited\Blue Prism Automate

Import the .dll with absolute path and and the namespaces required from the .dll file. Like wise you can create custom VBO's with your requirement.

NOTE: This may cause errors while deploying the solution to other environment. The solution will be dependent on the .dll reference if not found, code/BOT will crash.