07-16-2020 05:58 AM - edited 07-16-2020 06:00 AM
Hello together
I am trying to print a html file by using active x with object "IWebBrowser2" and it's my first time that I use active x 🙂
Setup: LabView 2019, 32-bit with Win7 64-bit computer.
What I want to do:
Goal ist to program the sequence like an operator opens the html file, which opens it with the InternetExplorer/Firefox and clicks on File-Print.
I know that I could use the "report generation" but after some tests, I would like to use the way with active x.
First question - are there some negative points by using active x?
Second question - could anybody help me, why my code doesn't work?
Someone had the same problem as I have, but even with his solution, it does not work: https://forums.ni.com/t5/LabVIEW/Print-file-via-ActiveX-and-it-is-not-found-always/td-p/1667298/page...
I analysied as well the code under find examples "browser" -> "ActiveX Event Callback for IE", but can't find my bug.
Alll Vi's with html-file are attached.
Why are there so many "IWebBrowser2" Objects and how can I find out which one is the one, that I need? Because I saw that the property/invoke nodes entries changes sometimes by using another object...
So this is my first vi. Silent and Visible doesn't work, it opens always the internet explorer, but it open it:
and the second one, which is never exectued (callback vi):
It doesn't work even if I copy this code into the first vi. I always receive an error...
Thx in advance.
07-16-2020 06:03 AM
By the way the error is:
"Error -2147221248 occurred at Trying to revoke a drop target that has not been registered
in IWebBrowser2PrintHtmlFile.vi
This error code is undefined. Undefined errors might occur for a number of reasons. For example, no one has provided a description for the code, or you might have wired a number that is not an error code to the error code input.
Additionally, undefined error codes might occur because the error relates to a third-party object, such as the operating system or ActiveX. For these third-party errors, you might be able to obtain a description of the error by searching the Web for the error code (-2147221248) or for its hexadecimal representation (0x80040100)."