+ Reply to Thread
Results 1 to 4 of 4

Duplicate Declaration in Current Scope

  1. #1
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Talking Duplicate Declaration in Current Scope

    Hi folks,

    I'm trying to add a True/False Boolean to a Check File Exists script that I've been useing.
    Basically if the Boolean is True I'm checking the existance of 2 files, otherwise just the one.

    I've been playing about trying to set up an If statement within the script but the cycles seem to be causing problems.

    With the below code I'm getting Compile Error; Duplicate Declaration in Current Scope.
    Any suggestions on the best way to get around this?

    I want to try avoid having the If statement call a seperate Sub.


    Please Login or Register  to view this content.
    Last edited by TonyforVBA; 11-23-2011 at 08:24 AM.

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,255

    Re: Duplicate Declaration in Current Scope

    Why are you declaring the same variable twice? Remove the second declaration, or use a different variable.
    Remember what the dormouse said
    Feed your head

  3. #3
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Re: Duplicate Declaration in Current Scope

    Haha, I dont know what I was at there. I think I need another cup of coffee.
    Cheers
    Tony

  4. #4
    Forum Contributor
    Join Date
    02-07-2011
    Location
    netherlands
    MS-Off Ver
    Excel 2003
    Posts
    128

    Re: Duplicate Declaration in Current Scope

    Please Login or Register  to view this content.
    Remove the line you can only Dim 1 time for a variable within a subject



    also:
    Please Login or Register  to view this content.
    this doesnt make much sence except making it harder for your self:
    declaring a multi array if u both set the same value?

    Remove the (100)/ (1)/ (2)/ (I) and u got the same result.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1