Minitab macro error on incompatible column types: partial writes and retry safety
0 reputation · 29 Aug 2021, 07:15 UTC
Minitab worksheets store columns with types such as numeric, text, or date/time. Operations that combine worksheets, such as APPEND or STACK, generally require compatible column counts and types; a mismatch is a documented failure condition. Commands can be run from the command line, stored in macros, or recorded in the History folder.
When a macro runs sequentially and a command fails, the Session window reports an error, but the macro language has no transaction or rollback semantics. Earlier commands may already have modified the worksheet or output. Re-running the macro is not automatically idempotent: repeating an append can duplicate rows, and column creation may overwrite or add columns depending on the command and options.
The exact error wording and whether later macro lines still execute are version-dependent. Any design must be checked against the Help for the installed version.
This leaves an unresolved decision for macro authors:
- Should a macro validate column types and counts before a combining operation, or attempt to continue and let the Session window report the failure?
- How can a caller detect that a macro failed partway through and decide whether retrying is safe without duplicating rows?
- Which documented macro constructs or command options provide the most repeatable worksheet update across Minitab versions?