Skip to content

File remains locked after excel_screen_capture on Windows #70

Description

@registered2nd

Bug Report

Environment: Windows 11, Claude Code

Description

After calling excel_screen_capture, the target Excel file remains locked (held open by the OLE/COM backend) for the duration of the MCP server session. Any subsequent attempt to write to or rename the file fails with a PermissionError.

Steps to Reproduce

  1. Call excel_screen_capture on any .xlsx file
  2. Attempt to save edits to the same file path (via openpyxl, another MCP tool, or file rename)
  3. Observe PermissionError: [Errno 13] Permission denied

Expected Behavior

The file handle should be released immediately after the screenshot is taken.

Actual Behavior

The file stays locked until the MCP server process is restarted. A lock file (~$filename.xlsx) is also left behind.

Workaround

Write edits to a temporary filename, then rename after the MCP session ends.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions