Search code examples
vbaexceldynamic-arrays

VBA Error code "Run Time Error 16, Too Complex"


When running a Dynamic array that is populated I am trying to get the contents of an element and receive the following error Run-Time Error '16': Expression too complex. The expression that is to complex?

Impactdays is a long, I populated the spreadsheet by simply stuffing the range into the array

ReportArray = Impact_Chart.Range("Data.EventNumber").CurrentRegion.Value

For i = LBound(ReportArray) + 1 To UBound(ReportArray)

If ReportArray(i, iImpactCol) > 0 Then
        iImpactDays = ReportArray(i, iImpactCol)<-- Tosses error here

        'more stuff

any ideas oh gurus of everything? :) Oh this is 2007


Solution

  • Check if you are not using something like

       If (Not MyArray) = -1  
    

    somewhere in your program. It has been reported a connection between that and your error.

    HTH!