01-12-2010 01:28 PM
Hello ,
I am working on Report generation toolkit for MS office, Excel to be specific.
I have a loop where in the program takes data from one sheet and pastes it to another sheet for performing some operations,
during this time, refnum value suddenly becomes zero. Strange behavior observed,
It says Error 1 occured at " Generate Report Get data to modify.vi:20
Possible reasons
Object 0X000000 is not valid
What happens to the refnum value suddenly ?
Thanks
Solved! Go to Solution.
01-12-2010 01:36 PM
Do you pass your refnum around the loop with a shift register?
If you do, does the refnum somehow change after one of the report generation VIs and need to be changed back?
Posting some code would help me debug your problem very quickly...
01-12-2010 01:37 PM
Hi there
It would be helpful to see an example of the code. Are you able to post the code or at least the section that is not working ?
Just out of interest are you using shift registers to pass the refnum around the loop ?
Also, are you performing and activities in parallel to the loop ? Perhaps on a different class or a class that inherits from the the class returning the error ?
Regards
01-12-2010 01:54 PM
01-12-2010 01:56 PM
Well after posting this question I too got the idea of replacing tunnel with the shift register,
if you could tell me what happens when I use tunnel and what happens when i use shift register while using refnum or any other data type.
Thanks.
Till now shift register is working fine for me, hope i dont get any error.
01-12-2010 01:59 PM
Wild guess!
If your tunnel is set for "Use defualt if not wired" and your code hits the un-wired case...
Ben
01-12-2010 02:46 PM
cancancanopen wrote:Till now shift register is working fine for me, hope i dont get any error.
When wiring across FOR loops, shift registers will keep the reference valid even if the number of iterations is zero.
(e.g. if one of the autoindexing array inputs is size=zero).
A plain output tunnel will get the default value for the datatype, so the original reference is lost.
(Of course (as Ben already mentioned) you also need to wire the reference across in all cases, so make sure all case output tunnels are solid colored.)