+ Reply to Thread
Results 1 to 4 of 4

Subscript out of range Error for token array

  1. #1
    Registered User
    Join Date
    05-16-2017
    Location
    Earth
    MS-Off Ver
    2013
    Posts
    2

    Subscript out of range Error for token array

    So I have this vba macro code, which initially worked like a charm. However, I decided to change the shapes it creates because they're not what I want. The initial code goes like this:



    Please Login or Register  to view this content.


    However, when I try to change msoShapeOval to msoShapeFlowchartProcess, and msoShapeFlowchartProcess to msoShapeFlowchartAlternateProcess, it comes out with a subscript out of range error at the line

    Please Login or Register  to view this content.
    I'm not sure how changing the shape created can cause a subscript out of range error. Can someone help me debug this? Thanks





    P.S This is what I currently have that's coming out with the error:

    Please Login or Register  to view this content.

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,913

    Re: Subscript out of range Error for token array

    Hmm, from the looks of it, you should have other module/sub/function outside of your main sub that defines and/or fills token_array and other variables as those are not defined in the sub routine itself.

    It would be hard for us to help you without full project. I'd recommend uploading file with entire project, demonstrating your issue and what the end result should be like.

  3. #3
    Registered User
    Join Date
    05-16-2017
    Location
    Earth
    MS-Off Ver
    2013
    Posts
    2

    Re: Subscript out of range Error for token array

    I have uploaded the file in question in this thread. Hope it'll help, thanks.
    Attached Files Attached Files

  4. #4
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,913

    Re: Subscript out of range Error for token array

    Sorry, I'd suggest you go to the author/source of the code to get help. See disclaimer in the module.

    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. [SOLVED] subscript out of range error when slicing array
    By chirp08 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-07-2016, 11:52 AM
  2. [SOLVED] Select Sheets based on variable array -ERROR 9 Subscript out of range
    By airmiles in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-19-2012, 07:28 PM
  3. Defining Array - Runtime error 9, Subscript out of range error
    By MaartenW in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-03-2012, 07:32 AM
  4. redim array error....subscript out of range
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-07-2011, 11:07 AM
  5. Subscript out of range error while populating array from range.
    By Aussiexile in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-04-2010, 02:22 AM
  6. dynamic array redim preserve: run-time error 9, Subscript out of range.
    By Broesel in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-20-2009, 08:39 AM
  7. Subscript out range error when redimensioning dynamic array
    By Crazy Cat in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-12-2006, 02:30 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