06-06-2012 10:54 AM
The new version of excel has the xlsx extension. It ia actually a file composed of multiple xml files. One of the xml file contains the data of the excel workbook. Is there a way to edit just the xml containing the data portion of the xlsx?
06-06-2012 01:02 PM
You can use the zip file functions to unzip the xlsx indo a folder and get access to each individule of the many XML files including the workbook.XML file. Labview does have a good set (although sometimes difficult to follow) standard XML Parser, you can oprn the XML and modify its content according to the workbook schema and resave it.
As for the actual syntax of the files I do not know the format but it was susposed to be some what open and published.
06-06-2012 01:05 PM - edited 06-06-2012 01:12 PM
Any reason you don't want to use the ActiveX server interface for Excel to do this?
Also, this appears to be the same question you've been getting help on: http://forums.ni.com/t5/LabVIEW/Edit-data-in-XML/td-p/2019078
In that other question you were basically asking for help in editing an XML file. Please keep the discussion regarding editing of XML files in that thread so we don't waste our time suggesting something that has already been discussed.
06-06-2012 01:18 PM
"Any reason you don't want to use the ActiveX server interface for Excel to do this?"
One reason is that it requires the activeX installed on the PC while the XML editor can be done purely in labview without ActiveX Object installed (I dont have office installed on some of my PCs).
06-06-2012 01:21 PM - edited 06-06-2012 01:25 PM
@falkpl wrote:
"Any reason you don't want to use the ActiveX server interface for Excel to do this?"
One reason is that it requires the activeX installed on the PC while the XML editor can be done purely in labview without ActiveX Object installed (I dont have office installed on some of my PCs).
Yes, obviously. I know that. But I was asking more in terms of perhaps the user doesn't know it can be done with ActiveX. Or, perhaps they know, but couldn't get it to work correctly.
EDIT: Plus, from this post, we see the user has the Report Generation Toolkit. So, I'm not sure what the real objective here is.
06-06-2012 01:27 PM
AND the user has already asked this question before: http://forums.ni.com/t5/LabVIEW/Reporting-toolkit-and-XLSX-File/td-p/1969849
Stop creating multiple threads!
06-06-2012 02:31 PM
i know that it can be done in another way. One way is through the report generation toolkit. However, I just wanted to know can it be done in another way. I wanted to know is there a easy way to access the xml inside the xlsx. That's probably not the way that I will use at the moment to solve my problem, but I am just curious. Also, the xml question that I was asking does not relate to excel at all. It just just a pure xml question, so I craeted another post.
06-06-2012 02:34 PM
don't you have to rename the xlsx file into a zip file before you can unzip it?
06-06-2012 07:24 PM
I dont have LV here right now but I think you can extract the xlxs into a temp file without renaming it, navagate to the workbook.xml, parse and modify the XML doc and rezip it and then rename it to an xlsx doc. Again just a thought I cant verify it right now.