Edit module lines
xlide_edit_moduleReplaces, inserts, or deletes line ranges in an existing VBA module and saves once. Requires a content token to prevent stale edits; preview only validates without saving.
Instructions
Replaces, inserts or deletes several line ranges in one existing VBA module and saves once. Lines are 1-based against the original source returned by xlide_read_module, without the attribute header. Each edit has start_line, end_line inclusive, and replacement text. For insertion, set end_line to start_line - 1; an empty replacement deletes the named lines. Ranges must not overlap. expected_content_token is required and refuses a stale edit. Set preview_only to validate the edits and see the proposed diff without saving. An applied edit includes the read-back diff and new token. Analyze the file afterward.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| edits | Yes | Line edits against the original module body, applied together. | |
| file_path | Yes | Absolute path to the Office file. | |
| module_name | Yes | Existing module to edit. | |
| preview_only | No | Show the proposed diff without saving. | |
| allow_protected | No | Permit saving a password-protected VBA project. Set true only after the user agrees. | |
| expected_content_token | Yes | Content token from the last read; required. | |
| allow_invalidate_signature | No | Permit saving a change that removes the VBA project's digital signature, where applicable. Set true only after the user agrees. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||