A LibreOffice Calc macro system for printing inventory labels on Dymo LabelWriter printers. Designed for cross-platform use on both Windows and Linux.
- One-click label printing directly from LibreOffice Calc
- Batch printing - select multiple rows to print multiple labels
- Cross-platform - works on Windows and Linux without external tools
- Configurable - adjustable font sizes and output modes
- Validation - mandatory field checking with clear error messages
- Dry-run mode - preview labels as PDF before printing
- LibreOffice Calc (tested with LibreOffice 7.x+)
- Dymo LabelWriter 450 (or compatible)
- Dymo 30334 labels (12mm × 50mm / ½" × 2")
Clone this repository or download KelderInventory.ods and LabelPrintMacro.bas.
git clone https://github.com/steemandavid/inventory-management.gitOpen KelderInventory.ods in LibreOffice Calc. The macro is embedded in the file.
Run the initialization macro to create the Config sheet:
- Go to Tools → Macros → Run Macro
- Navigate to KelderInventory.ods → Standard
- Select InitializeConfigSheet and click Run
Ensure your Dymo printer is named LabelWriter-450 in your system:
- Linux: Check in CUPS (http://localhost:631) or System Settings → Printers
- Windows: Check in Control Panel → Devices and Printers
Enter your inventory data in the spreadsheet with these columns:
| Column | Field | Required | Printed |
|---|---|---|---|
| A | Box | Yes | Yes |
| B | Bin | Yes | Yes |
| C | Label row 1 | Yes | Yes |
| D | Label row 2 | No | Yes |
| E | Label row 3 | No | Yes |
| F | Keywords | No | No |
| G | Comments | No | No |
- Select one or more data rows (not the header row)
- Click the Print Label(s) button
- Labels will be validated and printed
To preview labels before printing:
- Open the Config sheet
- Set Output Mode to
DRY_RUN - Click Print Label(s) - a PDF preview will be generated
┌────────────────────────────────────────────────┐
│ Label row 1 (bold) 03 │
│ Label row 2 02 │
│ Label row 3 │
└────────────────────────────────────────────────┘
Labels (78%) Box/Bin
(18%)
- Labels section (left, 78%): Up to 3 lines of text, left-aligned
- Box/Bin section (right, 18%): Box number above Bin number, centered
The Config sheet contains these settings:
| Setting | Default | Description |
|---|---|---|
| Font Size - Box | 14 | Font size in points for Box number |
| Font Size - Bin | 12 | Font size in points for Bin number |
| Font Size - Label 1 | 9 | Font size for first label line (bold) |
| Font Size - Label 2 | 7 | Font size for second label line |
| Font Size - Label 3 | 6 | Font size for third label line |
| Output Mode | DRY_RUN | PRINT or DRY_RUN |
| Show Complete Message | NO | Show completion dialog (YES/NO) |
| Export Path | (document folder) | PDF export location for dry-run |
| Macro | Description |
|---|---|
PrintLabels |
Main entry point - prints selected rows |
InitializeConfigSheet |
Creates/resets Config sheet with defaults |
ShowConfig |
Displays current configuration |
| Issue | Solution |
|---|---|
| "Config sheet not found" | Run InitializeConfigSheet macro |
| "No rows selected" | Select data rows (not header row 1) |
| Validation errors | Check mandatory fields A, B, C are filled |
| Printing issues | Verify printer name matches LabelWriter-450 |
| Labels not aligned | Ensure Dymo driver is installed correctly |
inventory-management/
├── KelderInventory.ods # Main spreadsheet with embedded macro
├── LabelPrintMacro.bas # Macro source code (for reference/backup)
├── FSD_Label_Macro_12x50mm.md # Functional specification document
├── README.md # This file
├── README.txt # Legacy readme
├── CHANGELOG.md # Version history
├── LICENSE # License file
├── generate_label.py # Python script for headless generation (optional)
└── test_label.py # Test script (development)
- The macro creates a hidden LibreOffice Writer document
- Page is set to portrait orientation (12mm × 50mm) matching the physical label
- Text is rotated 90° counter-clockwise for correct reading orientation
- Document is either exported to PDF (dry-run) or sent to printer
- The hidden document is closed automatically
The macro uses only LibreOffice's built-in printing capabilities without relying on:
- Shell commands (
lp,print, etc.) - Operating system-specific APIs
- External PDF tools
This ensures consistent behavior on both Windows and Linux.
Contributions are welcome! Please feel free to submit issues or pull requests.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Developed for basement/cellar inventory management
- Inspired by the need for quick, reliable label printing
- Built with LibreOffice Basic and UNO API
See CHANGELOG.md for detailed version history.
Author: Barraam Repository: github.com/steemandavid/inventory-management