12/13/2023 0 Comments Vba overflow error 6![]() If its in a hundred procedures, do it a hundred times. Does the app still work if you close it then re-open it? If so it may be storing the data into a global variable, which doesn't get cleared till the app is closed. If youre dealing with the workbook containing this code, specify it with ThisWorkbook where ever you need it. Having said all this, this wouldn't explain why the app would run the first time after installation, but fail the second. Run app and it works because it assigns the number to a variable which has been declared as an integer. As a Long, the maximum value will goes up to 2147483647. 1 I've gotten a Run-Time Error 6 while running some code, and while debugging I started to take away parts of it, until I was left with this very, very simple code, and still got an error Sub test () Dim NumberTest As Double NumberTest 1 / 2 End Sub Error happens on the third line when I step into the code. You can define it as Long to avoid the overflow problem. The maximum Integer is 32767, so it cannot hold large number. Say for example (just working with integers again), you've been passing order numbers to the app via your file, the app could be then taking that order number and assigning it to a variable which now can no longer cope with the data because you've reached the limit (badly explained so here's an example) From information above, it is highly suspect iCtr as Integer that caused the problem. The excel file is still running and trying to open the workbook itself. It could also be down to the actual data you're passing to it. I've just tried to change the dim of all related code from 'integer' to 'long'.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |