Log File

Depending on the amount of functionality you may want to create a simple log file.
One way of implementing this is to use a generic error handling routine in conjunction with a text file.
At the top of every subroutine and function add the following two lines of code:

At the bottom of every subroutine and function add the following lines of code:


Generic Error Handling Subroutine

Add the following subroutine to your project:


Using the Scripting Runtime Library

Add the following reference to your project Microsoft Scripting Runtime.

This reference is required if you want to use the File System Object library.


Add the following two global variables to your project.


Writing to the Log File

Add the following function to your project:


© 2026 Better Solutions Limited. All Rights Reserved. © 2026 Better Solutions Limited TopPrevNext