Cat On A Spreadsheet
If you often build utilities, custom functions, or macros that multiple people use, packaging them into an Excel Add-In (.xlam) is the most effective way to distribute and maintain them.
This post will guide you through:
What an Add-In is
How to build one
Best practices for distribution within your team
An Add-In is an Excel file saved in .xlam format containing VBA code, UDFs, forms, and modules. When installed, it:
β Loads automatically with Excel
β Makes functions and procedures available in any workbook
β Keeps your code protected and centralised
1. Develop Your Functions or Tools
Start with a module containing useful functions. For example:
This simple function reverses text input in any worksheet.
2. Save as Add-In
Click File > Save As
Choose Excel Add-In (*.xlam)
Name it clearly, e.g. MyUtilities.xlam
3. Install the Add-In
Go to File > Options > Add-Ins
At the bottom, next to Manage: Excel Add-ins, click Go...
Click Browseβ¦, locate your .xlam file, and tick it to load
Your functions are now available in any workbook without needing to import modules each time.
To prevent accidental edits or to protect intellectual property:
Open the VBA editor (ALT + F11)
Right-click your project > VBAProject Properties
Go to Protection tab, tick Lock project for viewing, and set a password
Save again as .xlam
β Shared Drive: Place the .xlam in a shared location and instruct users to install via Browseβ¦ as above.
β Network Location: Set up a read-only network folder containing your Add-In files for controlled updates.
β Version Control: Include version numbers in filenames or internally within the add-in to manage updates seamlessly.
Relative Paths: Avoid hardcoded file paths in Add-Ins unless you manage folder structures centrally.
Updates: Inform users to overwrite old versions and restart Excel.
Compatibility: Ensure the Add-In is tested on all target Excel versions in your team.
β Create a ribbon tab with your macros for easier access (future blog topic)
β Maintain a Change Log inside your Add-In
β Keep your Add-In modular, adding only necessary functions to avoid bloat
Excel Add-Ins transform scattered macros into professional, reusable, and maintainable tools for your team. They simplify onboarding, standardise your solutions, and save hours of manual copy-pasting code between files.
π Pattern Explanation
Pattern Matches
\[(.*?)\] Anything inside square brackets (timestamp)
\s+ One or more spaces
(\w+) Log level (INFO, ERROR, etc.)
: Literal colon
\s+ One or more spaces
(.*) The entire message
Extract email addresses
[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}
Extract numbers
\d+
Extract words inside quotes
"([^"]*)"
Regex-based parsing transforms your log file handling from brittle string splits to robust, pattern-driven data extraction. Combine this with dictionaries or advanced UDF libraries to build efficient parsers for any data source.
You might want to add headers for clarity:
You can call this sub before running ParseLogFile.
β οΈ Bonus: Handling Irregular Lines
Some logs may have missing or malformed entries. Use error handling:
While tools like Python are more common for text processing, VBA offers:
Native integration with Excel
Immediate visualization and manipulation of parsed data
A great option for non-developers working in Excel-driven environments
VBA is more than just forms and macrosβitβs a lightweight data processing engine built right into Excel. With a bit of string manipulation and file handling, you can turn chaotic log files into structured, actionable data in minutes.
Want to go further? Try:
Parsing multi-line log entries
Highlighting rows with ERROR or WARN
Exporting results as a CSV or Excel table
Cat On A Spreadsheet