06-05-2012 07:58 AM - edited 06-05-2012 07:59 AM
I have an excel template and I want to read data from this file.
Its not a small file, I could read 10 column from this data but after 10 column programs got an error "about property node" no matter how large the file is.
Here is my program and my template file.
06-05-2012 08:17 AM
An error where? What is the exact error code, and where does it occur? I ran your subVI that reads the Excel file and did not encounter an error, even when telling it to read 12 columns (the additional columns were converted to be empty string).
As for the code: You are not properly doing the ActiveX programming. You should be calling the Quit method at the end of the code, not at the beginning. It makes no sense to try to quit Excel before you've actually done anything. You should not need to resort to using taskkill to quit Excel. Please review the example that ships with LabVIEW that shows you the proper way to do it.
06-05-2012 08:33 AM
An error on Ranger value2 property node.
Error code is : -2147024882
Source : Property Node (arg 1) in ExcelParametreOku.vi
I'm using the task killer because Excel.exe doesnt close after my code stopped.
I've tried to quit excel but it didn't work.
I'm using task killer
06-05-2012 09:39 AM
The fact that Excel is still running means that your code is wrong, most likely references that are not closed.
Take the previous suggestion and read up on how to properly work with Excel.
06-05-2012 10:56 AM
Did you look at my code ?
06-05-2012 11:06 AM
I can't speak for nyc, but I certainly did look at your code. That's why I said you were doing the ActiveX programming incorrectly. I have never had to resort to using taskkill to quit out of Excel when manipulating Excel from LabVIEW.
The specific error code that you are seeing is a "Not enough storage is available to complete this operation" error. This implies a memory leak. Looking futher at your code you shouldn't even have the opening/closing of Excel inside the subVI. Since this is being called in a loop you are effectively opening/closing Excel each time the loop in "Start" VI iterates. Opening/closing of Excel should be done once.
Also:
06-11-2012 03:57 AM
First, thank you smercurio_fc for taking you time.
1. I removed the task killer, you were right. I was just trying to solve my problem in an alternative way.
2. I removed the subVI and I copied it into the main VI. But nothing changed. I'm still getting this storage error.
The other thinks you said. you were right to. I removed all of them.
Now I'm still getting this error. If we focus on just excel application VI. How could I fix this error, still. Because I'm still getting this storage error. I'm using the same .xlsx file and the VI which I uploaded. Where am I doing wrong?
06-11-2012 07:31 AM
NO.
You're not listening. I told you not to call the Application Quit until the end. Did you do that? No. Your code still leaves Excel running in the background.
An event structure is not designed to reside on a block diagram on its own like that. There are a couple of very specific cases when you'd want an event structure all by itself. This isn't one of them. Let me guess. You're running the VI by using the Run Continuously button, right? That's also wrong, if you're doing that.
I cannot get the error you are getting. The only thing I can think of is that it has to do with the specific version of Office that you are using.
06-11-2012 08:31 AM
What do you mean about the "specific version of Office". I'm using MS Office 2007 but my customers could use any... Does it really matters? If it matter, how could I design this code to make it usefull for every version of Office.
I've changed the code but I uploaded the wrong VI I'm sorry.
Now I removed the event structure either. Still getting this error. 😕