LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Report generation Toolkit: Excel report functions error -2146827284

Check in the task manager to see if one or more instances of Excel is open and running. That's what my problem turned out to be.

0 Kudos
Message 11 of 17
(1,346 Views)

Thank you for reply! Yes, I was checking, and currently I've implemented the same workaround, as you did - that if during opening of xls file there is error, it kills excel.exe process.

But also, I had the following error. When I was trying to write text into excel cell, I received this error also. I've checked, and the source of the problem was "Merge" function, inside of (I'll give only relative VI names, from Report Generation Toolkit) ...\_exclsub.llb\Excel_Get_Range.vi, which was called inside of ...excel.llb\Excel Merge Cells.vi, which is called from ...excel.llb\Excel Easy Text.vi. 

This last VI has 2 inputs - start cell, and end cell. And it tried to merge cells, and dropped an error.

To overcome it, I've started to use Excel Easy Table.vi, to write value to the single cell.

But, anyway - if the problem is in the not proper closed xls file, then why it is not closed? Inside Dispose Report.vi everything seems to be OK, all references are closed, application is quited, etc.

And all the time to kill the process - it's not very correct approach, indeed; but at least it works - because user can meanwhile work with some others xls files...

0 Kudos
Message 12 of 17
(1,340 Views)

You're right. The work around didn't adress the original error source. It dealt with the secondary problem of excel not closing after the initial error and subsequently getting an error trying to open excel when an instance was already open.

My original error was after running the first time on a new PC with a new install of office. initially getting errors with the application control functions that had worked previously. After reinstaiating those functions (property nodes, invoke nodes) I only had the error caused by having excel already open.

0 Kudos
Message 13 of 17
(1,329 Views)

I do have a Read_Excel vi that seems to be pretty stable. It's likely something copied from somwhere and modified.

Message 14 of 17
(1,321 Views)

Thank you! I'll check them, maybe they these VIs will be enough for my purposes...

0 Kudos
Message 15 of 17
(1,317 Views)

Dear Kosist90,

 

     I've posted several demos of RGT/Excel examples on this forum that all seem to work (though I'll confess I'm using Office 2010, so maybe it would break with Office 2013 ...).  While I cannot guarantee that you haven't found a "real bug" in RGT, I suspect that (you'll forgive me, I hope) you might be doing something either "wrong" or "sufficiently novel that it doesn't work".

 

     I (and other Forum contributors) would be glad to look at your code and potentially find/fix the problem.  If you do choose to post your code, please post it in an "executable" form, i.e. either attach a VI or create and insert a Snippet (from LabVIEW's Edit menu, then inserted with the Insert/Edit Image tool on the Forum Post's Toolbar).

 

Bob Schor

0 Kudos
Message 16 of 17
(1,307 Views)

Dear Bob Schor,
thank you very much, I send you the code.
In real project, rows, where I need to put data, are not in order, they are in different places (like, in rows 0, 2, 3, 10, 15) so I need to put data one-by-one, not like just one array of numbers. In WriteDataField.vi there is disable structure with working for me solution, and not working.
Also, I open and close xls file each time, b/c user can also work with xls file meanwhile the application is running. Also, I tried to open xls file reference only once, and close also after application is closed, but it didn't help.
Surprisingly, on another PC code is working. I'm using Office 2013, maybe it is a problem for this... Yesterday I've reinstalled it, but it also didn't help.
Please, if you have time, have a look at it, maybe you will have some ideas.
Thank you very much!

0 Kudos
Message 17 of 17
(1,283 Views)