Solved

VB 2005 variable hides a variable in an enclosing block

Posted on 2007-11-14
4
3,276 Views
Last Modified: 2013-11-26
In the following line I get the error
Variable 'rfound' hides a variable in an enclosing block
Dim rFound As Microsoft.Office.Interop.Excel.Range

Not sure what this means
0
Comment
Question by:murbro
  • 2
4 Comments
 
LVL 53

Accepted Solution

by:
Dhaest earned 500 total points
ID: 20279899
Variable '<variablename>' hides a variable in an enclosing block  

A variable enclosed in a block has the same name as another local variable

http://msdn2.microsoft.com/en-us/library/wtk40des(vs.80).aspx
0
 
LVL 53

Expert Comment

by:Dhaest
ID: 20279905
Just rename Dim rFound As Microsoft.Office.Interop.Excel.Range
0
 
LVL 4

Expert Comment

by:tmwest
ID: 20279911
A variable enclosed in a block has the same name as another local variable.

http://msdn2.microsoft.com/en-us/library/wtk40des(vs.80).aspx
0
 
LVL 23

Expert Comment

by:Ashish Patel
ID: 20279912
Why do you want to declare a variable with an enclosing block?
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
TimeZone, day light savings, Sql server, asp.net 6 38
Iteration Help (Asp.net VB) 5 35
ASP.NET MVC -Update model when click on <li> element 29 64
Data organization issue 7 36
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question