+ Reply to Thread
Results 1 to 3 of 3

VBA script error help: Run-time error'9': Subscript out of range.

Hybrid View

TrinhNgocAnh VBA script error help:... 10-20-2018, 04:15 AM
AliGW Re: Why it didn't work? 10-20-2018, 04:21 AM
dotchiejack Re: VBA script error help:... 10-20-2018, 05:34 AM
  1. #1
    Registered User
    Join Date
    10-20-2018
    Location
    HaNoi
    MS-Off Ver
    2010
    Posts
    1

    VBA script error help: Run-time error'9': Subscript out of range.

    Hi Pros!
    i'm newer in VBA.When i wanna open a file excel that's name "HNI_ROUTE_HO SO.xlsx" by code like this:
    Sub ActiveWorkBook()
    
        Application.Workbooks("HNI_ROUTE_HO SO.xlsx").Activate
    End Sub
    It didn't work and have warning: Run-time error'9': Subscript out of range.
    Plesase explain for me this problem.
    Thanks!
    Last edited by AliGW; 10-20-2018 at 04:22 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,132

    Re: Why it didn't work?

    Welcome to the forum!

    I suspect, from this opening post, that you have not read our forum rules. Please do so now (link at the top).

    I have added code tags for you this time - please do so yourself in future (instructions in the forum rules).

    Your title is not acceptable - I will change it for you this time to show you what we expect of you in future.

    Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Valued Forum Contributor dotchiejack's Avatar
    Join Date
    05-21-2015
    Location
    Antwerp,Belgium
    MS-Off Ver
    2016
    Posts
    507

    Re: VBA script error help: Run-time error'9': Subscript out of range.

    Hi, welcome.
    Do you mean this?
    Sub dotch()
        Workbooks.Open ("HNI_ROUTE_HO SO.xlsx")
    End Sub
    Click the * Add Reputation below to say thanks.

+ 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. Replies: 6
    Last Post: 10-30-2017, 05:55 AM
  2. Can I declare a Variable as a Word document object? (Actually I did, but it didn't work!
    By Doc.AElstein in forum Word Programming / VBA / Macros
    Replies: 2
    Last Post: 02-15-2017, 03:03 PM
  3. [SOLVED] Sequential PO# didn't work
    By KG869 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-25-2015, 05:08 PM
  4. my vba cursor didn't work...any help pls...
    By reignkystar in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-17-2013, 01:50 AM
  5. query filter didn't work in access 2007
    By already in forum Access Tables & Databases
    Replies: 2
    Last Post: 02-24-2010, 10:01 PM
  6. Didn't work ( moving formula/cell )
    By Brenda in forum Excel General
    Replies: 7
    Last Post: 11-20-2005, 06:35 PM
  7. [SOLVED] Suggested answers didn't work
    By scratching my head in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-01-2005, 05:05 AM

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