+ Reply to Thread
Results 1 to 3 of 3

Subscript out of range (vba error) when two (2) excel files opened

  1. #1
    Registered User
    Join Date
    06-11-2022
    Location
    UAE
    MS-Off Ver
    365
    Posts
    2

    Unhappy Subscript out of range (vba error) when two (2) excel files opened

    Hi,

    I am using blow code in vba, but when two excel files are opened "Subscript out of range" error occur. But when i close the other excel file its working fine.

    Please Login or Register  to view this content.

    Please help me to remove this error.

    Regards,
    Khawaja M. Shakaib
    Last edited by AliGW; 01-03-2025 at 08:40 AM. Reason: Code tags added - please review the forum guidelines.

  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,301

    Re: Subscript out of range (vba error) when two (2) excel files opened

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not told us about this. You are required to do so. Cross-posts are allowed but you must provide a link to your posts on other sites.
    For new members: you will not be able to post a full URL, so remove the https://www. section and add one or two breaks to the rest of the address. A Moderator or Admin will then fix the link for you.

    Please see Forum Rule #7 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important: https://excelguru.ca/a-message-to-forum-cross-posters/

    (Note: this requirement is not optional. As you are new here, I shall do it for you this time: https://www.mrexcel.com/board/thread...pened.1268319/)
    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
    Forum Expert ByteMarks's Avatar
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    3,119

    Re: Subscript out of range (vba error) when two (2) excel files opened

    On this line, you also need to specify the workbook that "Boiler Data" is in otherwise it'll assume whichever one is Active. The error you receive suggests that the Active workbook doesn't contain a sheet called "Boiler Data".

    Please Login or Register  to view this content.

+ 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. Merging Files - Another Runtime error 9 "subscript out of range"
    By Yami_Excel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-15-2019, 07:09 AM
  2. [SOLVED] Excel 2013 - VBA Run Time error 9 : subscript out of range
    By lawscrew in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 06-08-2018, 11:42 AM
  3. Excel 2010 VBA - SaveCopyAs error 9 Subscript out of Range
    By rjhanson in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-09-2013, 11:19 AM
  4. [SOLVED] Subscript Out Of Range Error on Improting Excel Worksheet to Access
    By Aceso in forum Access Tables & Databases
    Replies: 2
    Last Post: 01-31-2013, 10:08 PM
  5. run-time error '9' subscript out of range 2007 excel
    By rulo777 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-30-2012, 10:10 AM
  6. excel 2007: run-time error '9': subscript out of range
    By VBQuery in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-09-2010, 03:54 AM
  7. Getting Excel Runtime Error 9: Subscript out of range
    By Ph8te in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-14-2006, 01:12 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