BUG: Run-time error '51' Internal error, ParamArray from Immediate window

onidarbe

Board Regular
Joined
Mar 22, 2013
Messages
65
I narrowed it don't to this:

Code:
Function test(oRange)  [COLOR=#008000]'called by A1:  =test(B1)[/COLOR]
    test2 oRange       [COLOR=#008000]'this works[/COLOR]
    Stop              [COLOR=#008000] 'BUG: "test2 oRange" in the Immediate window while here in debugmode gives:  "Run-time error '51': Internal error"[/COLOR]
End Function
Function test2(ParamArray xAllThis())
    Debug.Print "ok"
End Function
Does anyone know why or how to solve this? thanks
ps: I use the "test2" to print all variables to debug my code.
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Well, I just found other reports of this, all not answerd

Seems the only way now it to first copy the range before calling the function with the ParamArray
Code:
Function test(oRange)  [COLOR=#008000]'called by A1:  =test(B1)
[/COLOR]    set oCopy = oRange
    test2 oRange       [COLOR=#008000]'this works[/COLOR]
    Stop              [COLOR=#008000] 'BUG: "test2 oRange" in the Immediate window while here in debugmode gives: [/COLOR][COLOR=#008000]"Run-time error '51': Internal error"
[/COLOR][COLOR=#008000]                       '     "test2 oCopy" seems to work though [/COLOR];-)
End Function
Function test2(ParamArray xAllThis())
    Debug.Print "ok" 
[COLOR=#333333]End Function
[/COLOR]

 
Upvote 0

Forum statistics

Threads
1,222,827
Messages
6,168,482
Members
452,192
Latest member
FengXue

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