LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem opening and reading Excel after a saved event.

Hi all,

I working on writing and reading Excel 2000 using ActiveX (LabView 6.02). I managed to get the data to be written into the Excel but I have problem on reading it.

Excel manage to opened the last saved filename.xls. But
the content of the worksheet is not viewable. To demonstrate my problem, I have attached here my testing.zip, should you wish to help me.

Thank you,
juni
0 Kudos
Message 1 of 4
(2,872 Views)
Juni,
This is actually Excel problem. You are closing and opening reference to Excel so fast, that it doesn't have time to close itself in between.
I modified your VI, first to check for errors in the main two SubVIs. Then, I edited the Open Excel and Make Visible VI, so it opens a new instance of Excel every time. This will allow the previous instance of Excel, the one when you wrote to Excel, to close itself when it is ready.
Also, monitor the CPU usage when you run this VI. I jumps way high. This could also be a problem for Excel. You may want to modify your VI or maybe add some delays to prevent the memory leaks.
I hope this works for you.

Zvezdana S.
National Instruments
Message 2 of 4
(2,872 Views)
Hi Zvezdana,
Thank you very much for your time to answer my problem. I have indeed look at the modified codes. Yeah, I am opening quite fast the Excel and I also noticed that I did not close some of the reference to my workbook and worksheet.

I think I need to close the reference to the INVOKE NODE or PROPERTY NODE using Automation Close
Now, my codes are better. I no longer have problem with my codes.

Once again, thank you for looking into my codes.

By the way, does the Microsoft Office Report Generation Toolkit has this problem? As I am looking forward for an upgrade.

Grateful,
juni
0 Kudos
Message 3 of 4
(2,872 Views)
Juni,
With the toolkit VIs you will not have the problem with open references to the invoke and property nodes. That is taken care of in the VIs. The New Report VI also uses the Automation Open VI that you can set to open "new instance" every time.
If you still try to open and close Excel very fast, you may get the not viewable Excel. This is Excel's problem that LabVIEW cannot do anything about except to use that "new instance" option.

Have a great day.
Zvezdana S.
0 Kudos
Message 4 of 4
(2,872 Views)