Just to make it clear. All I want to do is to check in Excel 2007 if a
certain cells contains metadata - in xlsx file.
I do not normally have access to older version of Excel and it is only in
versions prior 2007 that some cells show '_xln.compoundvalue' in formula
instead of value.
Cells that show this function are (headings of the table below
aWorksheetName, WorksheetCodeName, Cell.Address, Cell.Formula,
Cell.Value):
Irrigation Arkusz40 $S$53 =_xlfn.COMPOUNDVALUE(94) 0,57
Irrigation Arkusz40 $S$61 =_xlfn.COMPOUNDVALUE(95) 19,6873111111111
Irrigation Arkusz40 $S$62 =_xlfn.COMPOUNDVALUE(96) 61,8690111111111
Irrigation Arkusz40 $S$70 =_xlfn.COMPOUNDVALUE(97) 30,9298888888889
Irrigation Arkusz40 $S$72 =_xlfn.COMPOUNDVALUE(98) 0,2944
Irrigation Arkusz40 $S$82 =_xlfn.COMPOUNDVALUE(99) 14,9157
Irrigation Arkusz40 $S$84 =_xlfn.COMPOUNDVALUE(99) 2,833983
Irrigation Arkusz40 $S$107 =_xlfn.COMPOUNDVALUE(100) 164,52998
Irrigation Arkusz40 $S$108 =_xlfn.COMPOUNDVALUE(100) 164,52998
I will split the XML into two posts.
Użytkownik "Peter T" <peter_t@discussions napisał w wiadomości grup
...
I misunderstood, I thought you were looking for metadata in Excel 2003.
I tried to create a file with metadata in a cell as per your sample. After
editing the xml in Notepad and recreating the xlsx it wouldn't open in
2007, at least not until after allowing Excel to repair it, then the
edited changes were removed.
Maybe the xml needs a bit more. Could you post the entire xml of a sheet
with just one cell (say F16), eg like this but with the metadata
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?
- <worksheet
xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
<dimension ref="F16" /
- <sheetViews
- <sheetView tabSelected="1" workbookViewId="0"
<selection activeCell="F16" sqref="F16" /
</sheetView
</sheetViews
<sheetFormatPr defaultRowHeight="15" /
- <sheetData
- <row r="16" spans="6:6"
- <c r="F16"
<v12842.655189999899</v
</c
</row
</sheetData
<pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3"
footer="0.3" /
</worksheet
(this is pasted after opening in IE, don't worry about the extraneous
dashes, I'll remove those)
First I changed
<c r="F16"
to
<c r="F16" s="190" vm="20"
then to
<c r="F16" vm="20"
both got 'repaired'
The other question of course is how did that metadata get in there in the
first place!
Regards,
Peter T
"IgorM" wrote in message
...
The issue with the given code is that in Excel 2007 (where I want to
examine the cell for metadata) there is no cell formula - just value.
The formula is only visible under Excel prior to 2007. I thought there is
some extra cell parameter that can be checked if the cell has some
metadata.
The xml for the file for cells with the metadata is:
</c
- <c r="F16" s="190" vm="20"
<v12842.655189999999</v
</c
So there is an extra vm parameter for these cells.
Kind regards
IgorM
"Peter T" <peter_t@discussions wrote in message
...
Curious!
"2.2.4 Metadata
Metadata is additional data associated with a particular cell or its
content. Metadata is recorded in BIFF8 for future extensibility purpose
only."
I haven't come across this but I assume the way to check in VBA is by
examining the formula you can see in the input bar. I can't test but try
this -
Function HasMetadata(rCell As Range) As Boolean
With rCell
If .HasFormula Then
' case sensitive
HasMetadata = Left$(.Formula, 20) = "=_xlfn.COMPOUNDVALUE"
End If
End With
End Function
I'd be interested to see the relevant 2007 XML
Regards,
Peter T
"IgorM" wrote in message
...
Hi
How can I check (using VBA) if a cell has some metadata associated (as
described he http://msdn.microsoft.com/en-us/library/dd953161.aspx).
I ask because I have an xlsx file with data that when opened in Excel
2007 shows values only. But when I save the same file in xls format and
open it in Excel 2003 it displays value in the cell but in formula box
Excel shows _xlfn.COMPOUNDVALUE(20) for instance.
Thanks
IgorM