LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Finding Specific Table in MS Word

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)

Thanks
uday
0 Kudos
Message 11 of 16
(2,025 Views)

@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?

 

Error.jpg

 

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

0 Kudos
Message 12 of 16
(2,020 Views)

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. Code.jpg

0 Kudos
Message 13 of 16
(2,014 Views)

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.

Thanks
uday
0 Kudos
Message 14 of 16
(2,005 Views)

@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

0 Kudos
Message 15 of 16
(2,003 Views)

As was said, this issue is probably caused by the way you're using the code in a loop. In the attached example the tables are read repeatedly in a loop without error. You can do something similar with another method.

Ben64

Word Get Table Data in loop.png

0 Kudos
Message 16 of 16
(1,995 Views)