+ Reply to Thread
Results 1 to 8 of 8

"Run-time error '9': Subscript out of range" in some computers!

  1. #1
    Registered User
    Join Date
    05-23-2016
    Location
    iran
    MS-Off Ver
    2010
    Posts
    27

    "Run-time error '9': Subscript out of range" in some computers!

    Hi friends...
    I have a question & I would be thankful if you answer ASAP....
    Why does this code run in some computers and it errors in others ????

    this is my code:

    Please Login or Register  to view this content.
    Last edited by m.zaeim; 06-10-2016 at 10:03 AM.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: "Run-time error '9': Subscript out of range" in some computers!

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    If posting code please use code tags, see here.

  3. #3
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: "Run-time error '9': Subscript out of range" in some computers!

    deleted until morderator requirements met.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  4. #4
    Registered User
    Join Date
    05-23-2016
    Location
    iran
    MS-Off Ver
    2010
    Posts
    27

    Re: "Run-time error '9': Subscript out of range" in some computers!

    can anybody help me?

  5. #5
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: "Run-time error '9': Subscript out of range" in some computers!

    My guess would be that some computers require "book1.xls" (or .xlsx .xlsm) while others will accept "book1"
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  6. #6
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: "Run-time error '9': Subscript out of range" in some computers!

    Another reason why this error would come up is if there are multiple instances of excel. If the workbook with the code, and "book1" are open in the same instance of Excel the code should work, but if "book1" is in a separate instance then you would also get that error.

  7. #7
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: "Run-time error '9': Subscript out of range" in some computers!

    See if this would fix your issue:

    Please Login or Register  to view this content.
    Last edited by Arkadi; 06-10-2016 at 03:24 PM.

  8. #8
    Registered User
    Join Date
    05-23-2016
    Location
    iran
    MS-Off Ver
    2010
    Posts
    27

    Re: "Run-time error '9': Subscript out of range" in some computers!

    Tnx all for your attention.. ESP dear mikerickson your answer worked my problem out.. cuze it was for windows folder option setting (..known file types) tnQ

+ 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" when referencing between workbooks
    By roberts23 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-08-2014, 10:33 AM
  2. [SOLVED] "run time error 9 subscript out of range" Help?
    By AMV in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-24-2014, 04:54 PM
  3. [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
  4. Replies: 1
    Last Post: 12-15-2011, 10:59 AM
  5. Error msgs: "Object varible or with block variable not set"; "subscript out of range"
    By menyanthe in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-26-2009, 04:58 PM
  6. [SOLVED] "Subscript out of range" error for: Workbooks("Test1.xls").Save
    By Just12341234 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-17-2005, 11:05 AM
  7. FileCopy Command Giving "Subscript Out of Range" Error Message
    By Jim Hagan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-15-2005, 02:05 PM

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