I often use the following construct in my VBA code to track the progress of my code execution:
Public Sub Cmd3HideUnhide(sWksName As String, sHideUnhide As String)
On Error GoTo ErrHandler
Dim sProcNameCmd3 As String
sProcNameCmd3 = sWksName & ".HideUnhide.CmdBtn3HideUnhide"
When I run Project Analyzer it registers an error with the comment:
Variable read before written (along some path): sProcNameCmd3 in HideUnhide.Cmd3HideUnhide Type: Logic
As I have declared the variable sProcNameCmd3, assigned a value to this variable and later in the same procedure use that variable in a procedure call, I do not understand why this is referred to as "Variable read before written". Surely assigning a value to a variable constitutes writing the variable?
I also do not understand what I should do to rectify the problem.
I shall be grateful to assistance in this matter.