08-23-2016 05:37 AM
Hi I am sorry i am unable to view the code now.
-Is it possible to post snippet(http://www.ni.com/tutorial/9330/en/) so that i can see the code.
-I am guessing may be some references were not closed properly that's why it might be throwing error in second run.(it is my speculation and could be wrong)
08-23-2016 07:45 AM
@P_innovative wrote:Hi All,
Solution 1(Bob_Schor): this is not what i was looking for but i think this could help me in future. Thank you.
Solution 2(ben64): I had already tried this solution before. But if i give index through control or constant i usually get some error with error code -2147023170(The remote procedure call failed. in MS_Word.vi). And if my code is running continously i obtain error alternatively that is table gets upated once and then error, and this is happening untill i stop(I am using LabVIEW version 2014). Could you please let me know the solution for this?
Regards,
Pragathi
Missing here is the big picture. The code that we showed you all do what you asked for, chances are what causes the error is related to the way you are calling the code repeatedly.
Ben64
08-23-2016 08:45 AM
Code i hav ealready uploaded for udka's reply. And code is same as your code. But then attaching your picture of my block diagram.
08-23-2016 09:30 AM
Hello,
-In the first vi there was no while loop and you didn't even mention it.
-You shouldn't be opening closing the document multiple times inside.
-You can open it outside the loop and close after your operations done.
-You shouldn't leave the references without closing and it leads to memory leakage.
-There is no delay even!!!
-Please check the attached vi. I think i tried to close all the references. Please take this as a start.
-I would suggest you to go throught the online tutorials available freely in NI.
08-23-2016 09:34 AM
@P_innovative wrote:
Solution 1(Bob_Schor): this is not what i was looking for but i think this could help me in future. Thank you.
Pragathi
If you replace my three function calls to the Report Generation Toolkit at the beginning, and the Dispose Report at the end, with the ActiveX functions you use, and keep the code in the middle that I posted, this should be "the code you are looking for". In particular, the "off-by-one" error that I seem to have found will probably be identical with your code. Also, notice that I take care to close all of the ActiveX references when I am finished with them, something that your code does not do.
Can you test my "inner" code with your "outer" calls and see if it works on your machine? If you get U10M, then try putting in the appropriate For loops to get the entire Table.
Bob Schor
08-23-2016 11:14 AM