Is there a way in VBA to know about variables that aren't being used?


Is there a tool, method or setting in VBA to warn about variables that have been Dim'med, but aren't being used?


MZ-Tools will search through your code and tell you what is not being used. The version for VBA can be found here.

The specific feature in MZ-Tools that performs what you asking about is Review Source Code:

The Review Source Code feature allows you to review the source code to detect some unused declarations (constants, variables, parameters, procedures, etc.).

Check to make sure that IIS and the perl DLL are linked with the same version of the C runtime library. (Use depends.exe or dumpbin /dependents).

To expand: the problem may be that IIS has its FILE* table in one place, and the perl DLL thinks it's going to be in a slightly different place. When perl goes to find the stderr handle, it treats random memory as a file handle, with predictable results.

By : Sam Mikes

A couple of suggestions:

  1. Make sure that the id of the worker process has write permission to the directory/file you are writing. I probably wouldn't give it full control of C:, though. Better to make a sub-directory.
  2. Write to the event log instead of a file using Win32::EventLog

This video can help you solving your question :)
By: admin