LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

excel generated errors after completion of VI

Hello everybody..
I created a VI that using activeX it opens an excel file from desktop, renames the worksheet "sheet1", and closing as well as saving the changes. It works ok, then  i open the excel file to see the changes , and when i close it it gives an error message "excel has created errors and will be closed bywindows" etc,etc.
I guess it's something to do with the order i close the automation references, but after a lot of tries no luck...
I am using LV7.1 and MS office excel 2000.

If anyone can help me please do...
Thanx a lot for your time guys...
Yiannis

I attach the vi if anyone wants to try it out!!
0 Kudos
Message 1 of 12
(3,506 Views)
Tried your VI under LabVIEW 7.1.1f2 and Excel 2003 (sorry don't have 2000) and did not encounter the error you received from Excel/Windows. Off-hand I don't see a problem with the order in which you're closing the references. I did, however, notice that Excel was still left running after the VI ended and that's probably what's causing your issue. You should check via Task Manager to see if the Excel process is still running after the VI ends. If so, add a "Quit" method for the Excel app reference.
0 Kudos
Message 2 of 12
(3,489 Views)
Thanx mate I'll try that...
0 Kudos
Message 3 of 12
(3,469 Views)
Guys I've managed to tackle this one by removing the Item-->index node. It seems like this one was causing the problem and excel.exe was staying in memory...
Cheers
0 Kudos
Message 4 of 12
(3,459 Views)

Hi all. I have almost the same problem again, but now I can’t tackle it for the moment.

I created this vi which is part of another vi, and it does this:

It creates a new excel at the first run, name it month.xls (June, July etc.) and it renames the worksheet according to the date e.g. 25 June 2008. It closes all refnums and applications. Then in 20 seconds (for debug reasons) it checks the date. If the PC clock is set to another date it checks the month if it’s the same it adds another worksheet to the previous excel, if its another month it creates a new excel and so on. If anyone wants to run it he has to change the date in this 20 seconds that the loop waits.

Problem: Excel stays in memory and you have to kill it from Task manager to open the created excel. I can’t see the problem since I close all references and quit the application at the end. I post this question if anyone wishes to help. Thank you very much in advance guys.

PS. LV7.1 MS Excel 2000 (with service packs).

 

Cheers

Yiannis

0 Kudos
Message 5 of 12
(3,387 Views)
Hi I_Pant,
i get an error at the second round, because your program try to rename the new tabpage to an existing name.
 
Hope it helps.
Mike
0 Kudos
Message 6 of 12
(3,379 Views)

Mike hi, thanks for the response.

You get this error because you have to change the date in the 20 sec wait of the loop...This vi is planned to run once a day, but for debug reasons I used a 20 sec while loop..

If you change your PC clock during the 20 sec interval, there is no error...

 

Thanks for trying mate...

0 Kudos
Message 7 of 12
(3,376 Views)
Hi I_Pant,
i get no error. Please see your vi with some changes. Don´t forget to change back the Excel sheet name from "Tabelle1" to yours. Smiley Happy
 
Hope it helps.
Mike


Message Edited by MikeS81 on 06-25-2008 08:23 AM
0 Kudos
Message 8 of 12
(3,361 Views)

Mike thanks for the response...

I have LV7.1 and I can't open your vi..If someone can convert it please..?

Thanks again

0 Kudos
Message 9 of 12
(3,357 Views)

Please guys lv8 to lv7.1????

 

Thanks...

0 Kudos
Message 10 of 12
(3,335 Views)