Skip to content

officecli set on inline string cells writes <v> without clearing <is>, causing Excel to display stale content #155

Description

@catsite05

Description

When officecli set modifies a xlsx cell that was originally stored as an inline string (<is><t>...</t></is> with t="str"), it writes the new value as <v>NEW</v> but does not:

  1. Remove the existing <is> tag
  2. Update the cell's t attribute

This results in a cell with both <v> and <is> present:

<!-- Before officecli set -->
<c r="A1" s="1" t="str">
  <is><t>original text</t></is>
</c>

<!-- After officecli set A1 --prop value="new text" -->
<c r="A1" s="1" t="str">
  <v>new text</v>                    ← new value written by officecli
  <is><t>original text</t></is>       ← old value, not cleared
</c>

Per the OpenXML standard (ECMA-376), a cell should contain either <v> (shared string index or numeric value) or <is> (inline string), never both. The t="str" attribute indicates the cell uses inline string mode, so Excel correctly ignores <v> and reads <is> — displaying the old value.

Expected behavior

officecli should either:

  • Option A: Write as inline string — replace the content inside <is><t>...</t></is> with the new value, or
  • Option B: Convert to shared string — change t to s, remove <is>, and add the value to the shared strings table

Actual behavior

  • officecli watch displays the new value (reads <v>)
  • Excel and other tools display the old value (reads <is>)
  • The downloaded file silently shows stale content with no error or warning

Steps to reproduce

  1. Create an .xlsx file with Excel containing a text cell (e.g., A1 = "hello"). Excel typically stores these as inline strings.
  2. officecli open test.xlsx
  3. officecli set test.xlsx '/Sheet1/A1' --prop value="world"
  4. officecli close test.xlsx
  5. Open test.xlsx in Excel — A1 still shows "hello"

Environment

  • OfficeCLI version: 1.0.110
  • OS: Linux
  • File format: .xlsx (OpenXML)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions