Solved

VB 2005 variable hides a variable in an enclosing block

Posted on 2007-11-14
4
3,272 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

856 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