Duplicate declaration in current scope RRS feed

  • Question

  • Here's an odd one. I have a procedure where I have declared strDivision as a string within the procedure and nowhere else in the entire project. Like this:

    Dim strDivision as String

    The only other time that strDivision appears is when I use it to concatonate somes string values. However, when I run the procedure I get the error "Duplicate declaration in current scope" which is not true. I've tried saving my workbook in case it's just something goofy. Same thing. What's going on?


    Monday, May 6, 2013 3:32 PM

All replies

  • could you give the complete sub? it will be easier to see where the mistake is...
    Monday, May 6, 2013 6:44 PM
  • I changed the variable name from strDivision to DivisionString and it worked. I didn't change anything but the name of the variable. So...hmmm..don't know why it worked, but it did. I think the VB Editor just hickuped and somehow in changing the name and saving it I corrected the internal error. Probably if I set DivisionString back to strDivision it will stil work.

    Let me try. Hold on...yep. It works. So I think it was just an error in memory or some strange think.

    Thanx for the reply.


    Monday, May 6, 2013 7:09 PM