Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

maintaining ID's when using Excel... 1

Status
Not open for further replies.

Sniipe

Programmer
Oct 9, 2006
115
IE
I'm not sure if this is an Excel or XML/XSLT issue.

I've an excel document which has been application created and has values like this

Code:
<Row ss:AutoFitHeight="0">
    <Cell><Data ss:Type="String">Active</Data></Cell>
    <Cell ss:StyleID="s92" id="Active"><Data ss:Type="Boolean">1</Data></Cell>
    <Cell ss:Index="4" ss:StyleID="s87" />
   </Row>

This is as I want it to stay as when I upload this document I can find my "Active" ID and pull the data from that easily... which is a 1 in this case

The problem is that if I have the Excel sheet open and modify that 1 cell I loose the ID and looks like this instead.

Code:
<Row ss:AutoFitHeight="0">
    <Cell><Data ss:Type="String">Type</Data></Cell>
    <Cell ss:StyleID="s88" id="Type"><Data ss:Type="String">normal</Data></Cell>
    <Cell><Data ss:Type="String">yes</Data></Cell>
    <Cell ss:StyleID="s87"/>
   </Row>

Why does Excel get rid of the ID and is there a way around this? I could give the row an ID and search for the second position (as the first position is just text)... Any help would be gratefully appreciated. Thanks
 
>...an excel document which has been application created...
>Why does Excel get rid of the ID and is there a way around this?
I think that has to be looked into how and why the "application" does this. It is probably not the result of excel per se, but the application layer on top of it?
 
The change doesn't occur because of the Application. The change does however occur on Excel drop down's only.

I got around this problem by setting the ID on the row and then using position(2) to get the second cell. Thanks anyway tsuji for your reply as always.
 
Thanks! But I would have thought that changes come from the application code (vba) behind the control (drop down) as you've mentioned it? If yes, that would be what I meant for application layer.
 
sorry, I suspected u meant that but then assumed u ment the Application code (c# in my case).

I didn't touch the VBA, but I can only assume that when you click on the drop down (which only has 2 value, True/False) it changes the whole cell overwriting the ID. If I did want to keep the ID I guess I'd have to drill down into the VBA code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top