+ Reply to Thread
Results 1 to 11 of 11

VBA error

  1. #1
    Registered User
    Join Date
    10-11-2023
    Location
    india
    MS-Off Ver
    2302
    Posts
    11

    VBA error

    Hi,

    I'm trying to run VBA code and it's prompting me the error 'Subscript out of range'.
    Can someone help me deal with this error.
    I have couple of modules in my project and forms too.
    HOw to identify this.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: VBA error

    If you have an array, for example, it means the index to that array is too high or too low. If it is referring to a workbook or worksheet collection, it means that element doesn't exist (is not found).


    Fast answers need visual help. Please read the yellow banner at the top of this page on how to attach a file and a mocked up solution.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    10-11-2023
    Location
    india
    MS-Off Ver
    2302
    Posts
    11

    Re: VBA error

    My excel has got empty data, but I must upload an image from my machine and extract it. How to handle this?

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: VBA error

    We don't want an image. That's not helpful. Please read the instructions at the top of the thread in the yellow box.

  5. #5
    Registered User
    Join Date
    10-11-2023
    Location
    india
    MS-Off Ver
    2302
    Posts
    11

    Re: VBA error

    My code is going unresponsive immediately after I ran. Help me with techniques. I don't understand the error. It's already and inbuilt code long back and I must debug it.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: VBA error

    Attach your workbook - nobody can help without seeing the code in situ.
    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.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  7. #7
    Registered User
    Join Date
    10-11-2023
    Location
    india
    MS-Off Ver
    2302
    Posts
    11

    Re: VBA error

    Sure., but not sure about the rules/guidelines and confidentiality of posting the entire code/modules.
    Last edited by vineesha93; 10-12-2023 at 05:54 AM.

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: VBA error

    posting the entire code/modules.
    We don't want the entire workbook. We need a small representative and anymised sample and the relevant code. Enough theat we can run the code and replicate the problem.

    If it has worked for a long time, what has changed recently? Window update? Office update? Changes to the workbook? Changes on the worksheets? Or the worksheet names?

  9. #9
    Registered User
    Join Date
    10-11-2023
    Location
    india
    MS-Off Ver
    2302
    Posts
    11

    Re: VBA error

    Pasting the code below,

    The scenario is there is a userform and a button. I must identify from were the button is being called.

    Please Login or Register  to view this content.
    Last edited by AliGW; 10-13-2023 at 03:06 AM. Reason: Code tags added - please review the forum guidelines.

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: VBA error

    Please review the forum guidelines on CODE TAGS. I have added them for you this time.

  11. #11
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: VBA error

    Hello,
    I really need a very quick help with vba.
    That's not how this forum works. People volunteer their time as and when they can. Do not use PMs in this way.

    You were asked for a sample file that demonstrates the problem. You haven't provided it. You haven't even identified where in the code it errors. And, without a file and instructions on how to replicate the problem, we can't help you.

+ 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. [SOLVED] Odd Error Handling Behaviour; goes to error handler even when no error?
    By kalikj in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-04-2018, 10:04 AM
  2. [SOLVED] Run-tim error -2147467259(80004005): Automation error Unspecidied error
    By mattress58 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-25-2014, 12:12 PM
  3. Excel macro (compile error. syntax error.) error
    By salar_younis in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-06-2014, 06:11 AM
  4. Receiving following error “Complie error : syntax error” Help
    By masond3 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-02-2012, 10:19 AM
  5. Error "run-time Error '1004': General Odbc Error
    By D4WNO77 in forum Access Tables & Databases
    Replies: 2
    Last Post: 07-16-2012, 09:55 AM
  6. Error 75 File/Path access error, sometimes Error 1004
    By smokebreak in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 02-16-2011, 02:35 PM
  7. [SOLVED] Error Handling - On Error GoTo doesn't trap error successfully
    By David in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-16-2006, 02:10 PM

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