+ Reply to Thread
Results 1 to 4 of 4

Overflow error when using MID on long string

  1. #1
    Registered User
    Join Date
    01-19-2011
    Location
    Brighton, England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Overflow error when using MID on long string

    Hi all,

    I am using the following code to retrieve 700 bytes of data at a time from a long string and work on them in a loop. When it get's to character 18200 (loop 26) I get the overflow error Run-time error '6'.

    Please Login or Register  to view this content.

    The string can vary in length anywhere between 50,000 and 2,000,000 character long.

    Any idea what I can do to work around this issue?

    Many thanks in advance.
    David

  2. #2
    Forum Guru shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Overflow error when using MID on long string

    Change your Integer declarations to Long.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    01-19-2011
    Location
    Brighton, England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Overflow error when using MID on long string

    WOW!

    That was a super quick response and it worked. Thank you so much!

    David

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Overflow error when using MID on long string

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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