Version 1.3.0
(c) Gustav Brock, Cactus Data ApS, CPH
Set of VBA functions to:
- zip and unzip zip files and folders
- compress and decompress cab (cabinet) files and folders
- tar and untar archive folders
for both 32- and 64-bit. No third-party tools used, only a single code module.
The main goal for the functions is not to offer all sorts of fancy compression and expanding methods and options but, with code, to closely mimic what you manually can do with Windows Explorer.
However, while Windows Explorer's single option for compressing files or folders is to right-click and select Compress to zip file ..., included here are functions not only to create zip files, but also to create cab, tar, and tgz files.
A secondary goal is to make the call of the functions as simple and possible. As a result, any operation can be performed with a single line of code with only a few (all optional) arguments.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc.
In VBA, you can also handle normal files and folders, but to zip folders take a little more - and that you'll find here.
Windows Explorer lets you open cabinet (cab) files like any other folder, though for reading only.
In VBA, you can easily handle normal files and folders, but opening and, indeed, creating cabinet files take a lot more - and that you'll find here.
Windows Explorer (of Windows 11 or later) lets you open archive folders (tar and tgz) files like any other folder, though for reading only.
In VBA, you can easily handle normal files and folders, but opening and, indeed, creating archive files take a little more - and that you'll find here, though Windows 10 or later is required.
Demos (to download) for Microsoft Access and Excel are located in the demos folder.
Top level documentation generated by MZ-Tools is included for Microsoft Access and Excel.
Detailed documentation is included as in-line comments.
Full documentation can be found here:
Zip and unzip files and folders with VBA the Windows Explorer way
Handle cabinet files and folders with VBA the Windows Explorer way
Handle Archive Files and Folders With VBA the Windows Explorer Way
If you wish to support my work or need extended support or advice, feel free to: