
ChibiArc — ZIP, 7‑Zip, TAR, ISO support in 64‑bit VBA (AES included)
So I made a thing. That thing is ChibiArc.
What is ChibiArc?
ChibiArc is a single‑class VBA module for reading and writing archive files (e.g.: ZIP, 7‑Zip, all manner of TAR variants, ISO, RAR (read‑only)) from 64‑bit Office applications. No third‑party DLLs, no COM objects, no magic spells. It uses archiveint.dll (Microsoft's implementation of libarchive), which ships with Windows 10+, and AES encryption is done via Win32 APIs.
If you've ever tried to zip/unzip files from VBA and ended up in a swamp of Shell calls, PowerShell hacks, or "copy to temp folder and wait… and then wait a bit more…", then this is for you.
How to use it?
Dim arc As New ChibiArc
' Create a ZIP with AES-256
If arc.NewFile("C:\output\secure.zip") Then
arc.Encryption = aeAes256
arc.PassPhrase = "how now brown cow"
arc.Add "C:\reports\" ' entire folder, recursive
arc.Add "C:\data\somefile.txt" ' single file
arc.SaveFile ' closes automatically
End If
' Read it back
Set arc = New ChibiArc
If arc.OpenFile("C:\output\secure.zip", "how now brown cow") Then
Debug.Print "Files: " & arc.FileCount
Dim entries As Variant
entries = arc.Dir("*.txt") ' wildcard support
arc.ExtractAll "C:\extracthere\"
arc.CloseFile
End If
Encryption
ChibiArc supports both ZipCrypto and AES (128/192/256). No, they are not interchangeable.
ZipCrypto exists purely because Windows Explorer can handle it. Frankly, that's about all Explorer can handle. Critically, Explorer cannot extract AES‑encrypted ZIPs.
ZipCrypto is apparently cryptographically vintage. I haven't personally tested it, but the entire internet assures me it's disturbingly vulnerable. If you have strong feelings about this, please direct your concerns to Microsoft. As we all know, they are tremendously receptive and responsive to unsolicited feedback from random VBA developers. Famously so.
So in short, use AES‑256 for anything that matters. Use ZipCrypto only when Explorer compatibility is non‑negotiable.
Limitations
Full list is on GitHub, but the main one is that ChibiArc currently supports 64‑bit only. 32‑bit support is coming, but in the meantime I genuinely recommend wqweto's excellent ZipArchive: https://github.com/wqweto/ZipArchive/
As always, any bugs, blunders, oversights, and general acts of coding inelegance are entirely my own. Any accidental sparks of brilliance you find are almost certainly someone else’s. Namely:
- wqweto - AES encryption functionality would not exist without wqweto's work on the topic - https://www.vbforums.com/showthread.php?862103 . Indeed, I wouldn’t have known about archiveint.dll at all without this GZIP solution.
- Inspired by Cristian Buse’s Excel‑ZipTools: https://github.com/cristianbuse/Excel-ZipTools/
The mascot, however, is all me. It was created entirely in Excel. Because of course it was.
MIT licensed. Feedback, bug reports, and telling me I've done something wrong are always met with varying degrees of appreciation, skepticism, and (mostly) good humour.