+ Reply to Thread
Results 1 to 8 of 8

Keep getting "Run-time error '6': Overflow

  1. #1
    Registered User
    Join Date
    02-18-2019
    Location
    Austin, TX
    MS-Off Ver
    Office 365
    Posts
    26

    Keep getting "Run-time error '6': Overflow

    I have a spreadsheet that previously worked but today keeps giving me overflow errors all the time, mostly when I call the Application,Calculation function:
    Please Login or Register  to view this content.
    I've read that this has to do with numbers being larger than their max, but I don't think that's the case here. I also read that it can have something to do with Temporary folder space? Those are two very different causes!

    The Application.Calculation function doesn't actually do any calculating, does it? Isn't it just supposed to return the method of calculation? Why would that keep giving me this error? I've tried using variable types other than Double for the return value, but to no avail. Double seems to work more often than the others.

    Thanks for any suggestions!

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Keep getting "Run-time error '6': Overflow

    Difficult to say without seeing the workbook and understanding a bit more about your system.

    For instance is this the only workbook that's open in memory? How large is it? Are there other programs taking up lots of memory.
    Clearly the error message, assuming it's correct, is telling you that you're trying to store too much data for the resources available
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    02-18-2019
    Location
    Austin, TX
    MS-Off Ver
    Office 365
    Posts
    26

    Re: Keep getting "Run-time error '6': Overflow

    Well, it's confusing, because most of the stuff I see online regarding this error is about assigning a single value to a variable that is not large enough to hold it. Like an integer overflow, trying to assign a value greater than the maximum int value. But the very first Google result is all about the registry and keeping temp folders clean. It seems totally unrelated and I would disregard it except that it's the top result. It's the only result I see like that, however. Every other result on Google is about the value assignment issue.

    It does seem like I only start getting this error after I run the new function I wrote today, which reads a bunch of data from a file. It's not holding onto the data at present though - just printing it out to the console. So I don't see how it consumes too many resources. And the file is not large, only 70 lines.

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

    Re: Keep getting "Run-time error '6': Overflow

    I can't imagine that line errors. Application.Calculation returns a Long for the calculation mode -- xlCalculationManual (-4135), xlCalculationAutomatic (-4105), or xlCalculationSemiautomatic (2)

    Why are you assigning it to a variable?
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Registered User
    Join Date
    02-18-2019
    Location
    Austin, TX
    MS-Off Ver
    Office 365
    Posts
    26

    Re: Keep getting "Run-time error '6': Overflow

    Well, I didn't write this code, I am only modifying it. But they are just assigning it to a variable to store the current mode, so that they can change it temporarily and then set it back afterward.

    So, now I am not getting the run time errors anymore. I didn't change anything. I closed the file and reloaded it, which I had tried before, but this time it seems to have helped.

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

    Re: Keep getting "Run-time error '6': Overflow

    That would be done more intuitively like ...

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    02-18-2019
    Location
    Austin, TX
    MS-Off Ver
    Office 365
    Posts
    26

    Re: Keep getting "Run-time error '6': Overflow

    Yeah - I tried that, and when it didn’t fix the error I just set it back to Double. I think the error must have been due to something else. It’s gone for now at least. Thanks for the replies!

  8. #8
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,523

    Re: Keep getting "Run-time error '6': Overflow

    Do you have any integer variables that you are assigning to rows? This commonly causes the "Run-time error '6': Overflow" error as an integer can only hold values in the range -32,768 to 32,767 whereas from Excel 2007 there are 1,048,576 rows. If this is case change the variable(s) to long.
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

+ 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. Copying data from Access to Excel: "Run-time error '6' Overflow"
    By lukelucky in forum Access Tables & Databases
    Replies: 1
    Last Post: 01-11-2018, 09:09 AM
  2. [SOLVED] Code "suddenly" starts giving me error 6 overflow
    By jayherring86 in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 11-20-2016, 07:38 AM
  3. Run-time error '6': Overflow HELP!
    By Nils88 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-14-2013, 06:46 AM
  4. [SOLVED] Run-Time error 6 'Overflow'
    By guatelize in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-20-2012, 07:08 AM
  5. Run time error 6 Overflow?
    By ben5496 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-06-2011, 09:00 PM
  6. Run-time error 6 : overflow
    By Mbrolass in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-09-2007, 03:18 PM
  7. Run-time error '6': Overflow
    By magoobee in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-16-2006, 12:54 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