BC30616: Variable '<variablename>' hides a variable in an enclosing block
A variable enclosed in a block has the same name as another local variable.
Error ID: BC30616
To correct this error
Rename the variable in the enclosed block so that it is not the same as any other local variables. For example:
Dim a, b, x As Integer If a = b Then Dim y As Integer = 20 ' Uniquely named block variable. End IfA common cause for this error is the use of
Catch e As Exceptioninside an event handler. If this is the case, name theCatchblock variableexrather thane.Another common source of this error is an attempt to access a local variable declared within a
Tryblock in a separateCatchblock. To correct this, declare the variable outside theTry...Catch...Finallystructure.
See also
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.