Random User Posted August 25, 2010 Report Share Posted August 25, 2010 (edited) Hi, I've got a program that converts Excel worksheets into 2D arrays of strings. I'm having a problem where Excel does not close if I use the 2D array for anything. If I do not use the array, Excel closes fine. I've attached Labview 8.6 files of both the working and nonworking versions. It would be great if someone can tell me what I've missed here. Suggestions for simpler ways to do this are also welcome, as I'm a little new at ActiveX. Thanks! Excel Test Works.vi Excel Test Fails.vi Edited August 25, 2010 by Random User Quote Link to comment
SuperS_5 Posted August 26, 2010 Report Share Posted August 26, 2010 Hi, It seams that you have a type mismatch here. I have not noticed this behavior before, but LabVIEW ignores the conversion if no output is wired. If a scaler (single string) is wired to the type input of the "variant to data" function, there are no errors. This could be caused because there is no data on the variant "value2". I usually use the report generation tool kit. It has functions for this kinda of work. Mike 2 Quote Link to comment
crelf Posted August 26, 2010 Report Share Posted August 26, 2010 If a scaler (single string) is wired to the type input of the "variant to data" function, there are no errors. This could be caused because there is no data on the variant "value2". Right - you're trying to read a single Excel cell into a 2 dimensional array - that's not going to work. Also, I'm guessing that there's an error on the error cluster after the convert to variant VI, which might be causing something downstream (prbably the Workbook|Close method) to not execute - that's why Excel isn't closing. I suggest you rearchitect your code a little to use the merge errors VI, instead of chaining all the errors into one wire. 1 Quote Link to comment
Random User Posted August 26, 2010 Author Report Share Posted August 26, 2010 Ok, you guys have helped me figure this out. What I'm doing works in the general case since I'm converting a range of cells to an array of strings (instead of a single cell to an array). But it's true that one of the worksheets in my workbook causes a type mismatch...must be some cell with a weird format or something. Removing that particular worksheet allows my program to run normally. Thanks! Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.