+ Reply to Thread
Results 1 to 7 of 7

Run-time error '9': subscript out of range

  1. #1
    Forum Contributor
    Join Date
    06-30-2008
    Location
    london
    Posts
    108

    Run-time error '9': subscript out of range

    Hi all,

    I have a macro which was perfected by the good people here on this forum and all was running well.

    I subsequently changed the file paths and file names, and updated the marco accordingly. I have obviously done something wrong as the marco no longer works and i am faced with the following error message "Run-time error '9': subscript out of range"

    I am not sure why this is happening. I have attached the macro below...

    Please Login or Register  to view this content.
    any thoughts?

    much appreciated,

    Nicko

  2. #2
    Forum Contributor
    Join Date
    06-30-2008
    Location
    london
    Posts
    108

    Re: Run-time error '9': subscript out of range

    i think i have made some progress. I hadnt changed the master excel sheet name to 'Data Dump', I have now done this in the macro and it looked like it was working, but now i am faced with another error "400"??? i dont know what this means or how to fix it.

    Any ideas?

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Run-time error '9': subscript out of range

    MyPath should end with \ not /

    What line fails?
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Forum Contributor
    Join Date
    06-30-2008
    Location
    london
    Posts
    108

    Re: Run-time error '9': subscript out of range

    ok i changed that in MyPath, but I am still getting the error message.

    I put in a Catch trap into the formula....

    Please Login or Register  to view this content.
    and the message box is telling me "The cell or chart you are trying to change is protected and therefore read-only.

    To modify a protected cell or chart, first remove protection using the Unprotect Sheet command (Review tab, Changes group). You may be prompted for a password."

    but the sheet isnt protected so I dont understand why this is happening???

    Many thanks,

    Nicko

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Run-time error '9': subscript out of range

    Take out the On Error statement and see what line of code fails.

  6. #6
    Forum Contributor
    Join Date
    06-30-2008
    Location
    london
    Posts
    108

    Re: Run-time error '9': subscript out of range

    It fails on this line...

    Rng.Copy wb.Sheets(1).Range("B1")


    With a message box "run-time error '1004' application-defined or object-defined error"

  7. #7
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Run-time error '9': subscript out of range

    Nicko,

    I'm not sure shg is around, but in the meantime try...

    Please Login or Register  to view this content.
    Seems to work for me...
    HTH
    Regards, Jeff

+ 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