ni.com is currently experiencing unexpected issues.
Some services may be unavailable at this time.
06-10-2010 01:19 PM
06-10-2010 01:49 PM
this is what happened when I do as you mentioned.
and it is correct when I use the FileFormat constants
It saves in the correct format and doesnt through me the above error, but the only problem now is that it will not included the 2nd worksheet I added.
06-10-2010 01:55 PM - edited 06-10-2010 01:56 PM
Alright, problem solved. I SHOUL'VE SAVE WORKSHEET INSTEAD OF WORKBOOK
thank you everyone for helping me get to this point. thank you for being patience with me as well.
06-10-2010 01:56 PM
06-10-2010 10:54 PM
Your code has several flaws and peculiarities:
06-11-2010 10:47 AM
thank you so much for giving me pointers and help.
i will look into it and come back to this message for help if i still have questions with your suggestions.
06-11-2010 05:11 PM
I think I can see where you are coming from.
If any of my excel program is open, it will cause this to happen.
can you sugguest a way to fix it?
i thought i am closing it properly because i did saved, and close the workbook.
you can't use both? SometimesI dont want to wire to the N, but labview 7 required me to. I am not sure why.
I can see that i could have used the iteration. It is better
06-11-2010 05:45 PM - edited 06-11-2010 05:45 PM
krispiekream wrote:
- Opening references and then not closing them. You do this in the for-loop where you are creating all those Range objects . This will likely prevent Excel from quitting properly.
I think I can see where you are coming from.
If any of my excel program is open, it will cause this to happen.
can you sugguest a way to fix it?
i thought i am closing it properly because i did saved, and close the workbook.
Yes. Close the references. This is a general ActiveX issue. The references need to be closed in the reverse order in which you opened them. I didn't look in detaill at that loop, but you should be able to replace the duplication inside by using an inner loop.
- What is the Spreadsheet File to String Array VI? Is this doing the same thing that Read From Spreadsheet File does?
- I think it is the same. I forgot why my coworker used it, but it is used throughout my main vi
Perhaps this is from an older version of LabVIEW in which that VI was not polymorphic and only one version (the one that dealt with DBLs) existed? Newer versions of LabVIEW don't have this problem, so you can use the built-in VI directly.
- The wiring of all those constants to the Index Array function is unnecessary.
- can you show me what you mean?
Index Array will automatically index out the first element if you do not wire in an index value. If you resize the function, then all subsequent indices are automatically incremented by one. To start at a specific index you just need to wire the first one, and let the subsequent ones automatically increment by one. For example, to index out elements 5, 6, 7, 8, 9, 10 you can just do this:
Do not create paths using string operations. Use the path function Build Path.
- okay. got it. just curious on why? both works right?
Both work, but the path method is more robust. It is not platform dependent, and can catch invalid paths.
- Your VI is ridiculously large. This makes it untenable to modify and debug. This is lousy coding style.
- this vi is a subvi of the main vi. i didnt want to make subvis for a subvi, does that make sense?
No, and that is a poor excuse for not making subVIs.
06-11-2010 05:49 PM
krispiekream wrote:
- this vi is a subvi of the main vi. i didnt want to make subvis for a subvi, does that make sense?
I have made subvi's for subvi's for subvi's for subvi's...... Who knows how many levels I've gone. But my code is very readable and every vi fits on one screen. Once you know the function of the subvi, you don't need to see its code. Just a comment on the block diagram about what the subvi does. It becomes a black box. This is what makes large code readable and easy to understand.