+ Reply to Thread
Results 1 to 4 of 4

Run-time error 9 subscript out of range

  1. #1
    Registered User
    Join Date
    05-07-2018
    Location
    Arba Minch
    MS-Off Ver
    2003-2010
    Posts
    8

    Run-time error 9 subscript out of range

    Dear Excel forum users,

    This is Alazar from Arba Minch university Ethiopia and in a team we are conducting a research study on surface water hydrology using wetspa hydrological model.

    In doing this the model has been developed using excel and macros and i tried to follow the installation manual prepared by the developers, however whenever i run the program and click a button to update some worksheets based on the instruction and it is showing me the "Run-time error 9 subscript out of range". I tried to solve the issue by searching online but it is not helping me so i came to your forum seeking for support in fixing the issue. So i attached the file for you to test it and tell me how this issue can be resolved. in order to see the excel file open Oslovak\WetSpa\Model\Output then you will find WETSPA_ANALYSIS_TOOL.xls file and open it, then you will see the main page and click on the update all sheet then the error will come which i can't solve it and needs support on it. So to make all this happen you need to open the macro file and replace the file location according to where you place your file in 14 different lines. If you need any info on how to set up the model you can find it on the official web site ( i can to provide any link because i am new to this forum so please help me to figure out the issue).

    Any help to solve this issue will be appreciated and welcomed.

    Thanks,
    Attached Files Attached Files

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Run-time error 9 subscript out of range

    Your file cannot be tested because the first thing it does it tries to open a file called

    C:\Jiri\WetSpa_model\model\output\mean.txt

    You did not include this file so an error occurs here and it cannot go further.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    05-07-2018
    Location
    Arba Minch
    MS-Off Ver
    2003-2010
    Posts
    8

    Re: Run-time error 9 subscript out of range

    Dear Jeff,

    Thanks for your answer however i have the file mean.txt inside C:\Users\alazar\Desktop\Oslovak\WetSpa\Model\output\mean.txt ( C:\Jiri\WetSpa_model\model\output\mean.txt) but still the problem exists so what can possibly cause this Run-time error 9 subscript out of range???

    For your information i attached you this two images to show the file exists and where the error is pin pointing

    file location : mean.JPG
    error on micro: error.JPG


    Thanks,
    Last edited by alazar; 05-08-2018 at 03:45 AM.

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Run-time error 9 subscript out of range

    First, I think my point was not clear. I am not saying that your problem has to do with the file mean.txt. But if I do not have the file mean.txt, I cannot run your code and therefore cannot diagnose the problem reliably.

    However, looking at the line of code you showed

    Please Login or Register  to view this content.
    I think what is intended is

    Please Login or Register  to view this content.
    and for

    Please Login or Register  to view this content.
    I would use

    Please Login or Register  to view this content.
    But I can't test this without the file mean.txt.

    (Also, the code here is very inefficient. It might work but it looks like it was developed using the macro recorder for guidance, so generates a lot more code than what is necessary. There is too much code for me to try to help with that though.)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Run time error '9': Subscript out of Range
    By mklindquist0815 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-30-2016, 12:35 PM
  2. [SOLVED] Run-time error '9': subscript out of range - error occurs on multiple computers except one
    By BrettE in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-06-2014, 11:19 PM
  3. [SOLVED] subscript out of Range (Run time error 9), need help
    By shiva_reshs in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-05-2013, 02:31 PM
  4. [SOLVED] Run Time Error 9 - Subscript out of range
    By kushmakarsharma in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-25-2012, 08:02 AM
  5. Run Time Error 9 Subscript out of Range
    By Petrolcb41 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-26-2010, 08:43 PM
  6. VB Run-time error '9'; Subscript out of range
    By lisabethvw in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-29-2009, 03:49 AM

Tags for this Thread

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