VBA Overflow error

aculham

New Member
Joined
Aug 13, 2008
Messages
6
Hello. I am having the following problem in a VBA macro i have written. I declare a bunch of variables and arrays, mostly longs and doubles, then run a DLL. After that, I redim one of my arrays (2D) to the right size and try to fill in some values. The array is a double and the values are less than one million. On the first element the code breaks and throws an overflow error. If I choose "Debug", I can then click continue and it finishes just fine as if there was no error. I can see in the debugger that the array is sized properly, has the correct type, etc. I have no idea what could be wrong here. Could it be a memory problem? Thanks in advance.
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
If I try to assign any value to myArray(i,j) it throws an error (for any i and j in the appropriate range). When it does, I tell it to debug and it takes me to that line. I am then able to hit "continue" and it finishes just fine. I even tried rebooting my machine and still nothing.
 
Upvote 0
Can we see the full declaration lines? How are i and j declared for instance and what are/should be their values at the time of the error?
 
Upvote 0
The code is huge so I won't post it all here. i and j are of type Long. But just in case I tried doing myArray(1,1) = 1 or 0 or 3.14159. None of them work.
 
Upvote 0

Forum statistics

Threads
1,215,133
Messages
6,123,235
Members
449,092
Latest member
SCleaveland

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top