LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

error at easy excel text in stand alone

Solved!
Go to solution

@aputman wrote:

@matt198717 wrote:

Path to template is correct because the template file loads.  Its only when i try to write to file through the excel easy text that i get the error.


How do you know the template file loads?  Does it open up on screen or are you doing error checks?  If not, don't assume that because the error pops up during the write process that the error occurred there....that it didn't occur somewhere prior to writing and was simply passed there thru wires.  


I did debug the error and it occurs at the easy excel text.  There is no error in the open template function and the tamplate does open.



-Matt
0 Kudos
Message 11 of 28
(1,996 Views)

Matt,

     Sorry I can't see the code, as I could test it and see if I can get it to work.  I've use the RGT to read and write Excel extensively, and have not had (many) problems.

 

     You say that the error occurs "on the first iteration".  If you don't want to show us the code, can you at least describe what you are doing?  What is "an iteration"?  [A list of the RGT functions in the context of your program would be helpful -- "I open Excel using a Template file, move to WorkSheet #2, write a table with header, switch to WorkSheet #1, and in a For Loop, write 2D arrays of data in a column, one array below the next.  I then Save the File and ... the program crashes when run as an executable.  However, if I run it in Development mode, the file gets written and looks OK".  [Something like that would be a lot of help].

 

     I think I might have an idea for you to try, but it depends on what you are doing.  Please tell us more ...

 

Bob Schor

0 Kudos
Message 12 of 28
(1,991 Views)

@matt198717 wrote:

@aputman wrote:

@matt198717 wrote:

Path to template is correct because the template file loads.  Its only when i try to write to file through the excel easy text that i get the error.


How do you know the template file loads?  Does it open up on screen or are you doing error checks?  If not, don't assume that because the error pops up during the write process that the error occurred there....that it didn't occur somewhere prior to writing and was simply passed there thru wires.  


I did debug the error and it occurs at the easy excel text.  There is no error in the open template function and the tamplate does open.


OK...just making sure.  A couple of other things to try:

 

  • Make sure there is only one instance of Excel running in the task manager.
  • In the template file, are there any cells that are merged?  Trying to write to a merged cell may throw an error.
aputman
0 Kudos
Message 13 of 28
(1,987 Views)

Hi Bob,

 

I dont mind sharing the code, but id have to alter a good portion of the code because it is talking to external devices, but i can if we cant seem to figure it out.  Attached is where the error occurs at the easy excel text.  Now i actually just tested a simple create and write to excel stand alone and it actually worked.  So i dont think version incompatability is the problem.



-Matt
0 Kudos
Message 14 of 28
(1,986 Views)

there are merged cells and i was writing close to them.  I will check that.



-Matt
0 Kudos
Message 15 of 28
(1,984 Views)

So some suggestions and questions, questions first:

  • How much data do you write at a time?  I see arrays, but don't have any idea if you are writing 1 row, 10 rows, or 100 rows at a time.
  • Why are you using Excel Easy Text?  This forces Excel to merge cells (which may well be what you want to do), but the "more usual" thing to do is to write data in tabular form, rows and columns.

Now that I think about it, I wonder if your problem is using Easy Text instead of Easy Table.  Of course, I don't (yet) know what you are trying to write (i.e. what the data look like, and what the Excel Worksheet should have, e.g. "12 rows of 3 columns, starting in Cell D6".

 

Anyway, my suggestion was really about Excel Easy Table, and using the Start and Next clusters to help you out.  With Easy Table, you wire a Shift Register to Start, and put the starting Row/Column cluster as the input to your For loop,  Now, if you want subsequent loop iterations to do "down" in a column, wire Next Cell Bottom Left to the other terminal of the Shift Register, while if you want to have the loops go "across the page", wire Next Cell Top Right.  No need to figure out how many rows/columns you wrote, LabVIEW/Excel will do that for you.

 

I'll check in later, after dinner ...

 

Bob Schor

Message 16 of 28
(1,977 Views)

Hi Bob,

 

I had considered changing the easy excel text to easy table myself just for effeciency.   Im only writing a small 1d array of short strings in that portion of the code and in later parts of the code i write a short string. After your suggestion i did change that portion of the code and it did fix that one problem.  I write to the short strings at a later portion of the program using easy excel text and once again get the problem.  I could of course change every easy excel text to easy table, but i have to convert all my string into a 2d array.  This bigger question though, why is it that easy excel text works in development environment and not in stand alone?



-Matt
0 Kudos
Message 17 of 28
(1,965 Views)
Message 18 of 28
(1,960 Views)

Hi udka,

 

I have included the lvclass and nireport library already and still have issues.  I was getting different errors before i included those files.  Good link though. 

 



-Matt
0 Kudos
Message 19 of 28
(1,953 Views)

when you include lvclass and nireport from which folder you selected?

-can you try creating exe with RG11 and then try?

Thanks
uday
0 Kudos
Message 20 of 28
(1,949 Views)