08-16-2011 01:53 PM
That's all the code.
In order to upload the actual VIs I have to create a demo one.
What I want to succeed is to print the document after it has been loaded.
So, I include the code of printing, in the VI Ref, getting the Web Browser as the User parameter.
Maybe, I included this code, that is, the Node "IWebBrowser2" with the "OLECMDID_PRINT" parameter in the "cmdID" input, in the wrong place. I want to run it after the Event callback.
08-16-2011 05:24 PM
@nikosfs wrote:
That's all the code.
In order to upload the actual VIs I have to create a demo one.
What about the VIs that you actually have. Why can't you upload those? I don't know what you are doing, but simply adding the ExecWB to the "DocumentComplete Callback" VI that I uploaded works just fine for me. You should not be passing the WebBrowser control into the "User Parameters". That is already being passed into the callback VI. Attached is the modified "DocumentComplete Callback" VI.
08-17-2011 05:05 AM
Ok! Finally it works. The difference in my code is that after the print, I move the file to another folder. So, it moved the file before it could print it.
I didn't succeed to solve this problem, but if i moved this part of code, in the callback vi, and it now can print it, but without moving the file !! bizzard!
Here is the new code: (The User Parameter is the same Path as the URL input, that is the path to the file to be printed.)
VI Ref:
Now it can print but the code that moves the file to another folder is not working.
08-17-2011 07:59 AM
So when you said "That's all the code" what you were really saying was "That's all the code, except for the really important part that's the solution to this problem, but I'm not going to bother showing you because I don't think it's important."
Right?
08-17-2011 09:51 AM - edited 08-17-2011 09:51 AM
The code that caused the problem, that is, the file movement to another folder, was in my main code but there are also other parts of code and I could not determine where was the problem.
A small problem remains. Why the file cannot be moved after the print?
If it is easy to find, I would be glad to see a solution.
Thank you.
08-18-2011 12:24 PM
Do you get any errors when you try to move the file after it's printed? Do you close references to the file before moving it? You may be running into a resource lock.
08-18-2011 01:14 PM
Thank you for your reply.
I don't get any errors when trying to move the file. Neither do I close references to the file before moving it.
Probably there is a resource lock, because I use the file in the IWebBrowser2 Node, without closing its reference.
I show the "Close File" Function but I don't have a reference of the file to close it. I only use its path. So? What should I do?
08-19-2011 06:22 PM
First, make sure you have write permissions for both the file and the directory in which you want to move the file. Next, wire up error handling to the Move and see if it throws an error. That will help us troubleshoot.
08-20-2011 04:46 AM
I wired an error handling, and it doesn't throw any error.
I show again the code:
Main VI:
VI Ref:
I just tried to change a boolean value in the second frame, and it does not work. It remains always false.
08-22-2011 01:29 AM
Run the code in Highlighted mode with Retain values active (the two bulbs close to start arrow) it's great for these things.
It sounds like your ExecWB doesn't finish, which'd mean the vi gets stuck. Is this the case?
/Y