Histogram Invalid Reference

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



The following is an excerpt of some code I use to generate
histograms. It is within a loop that generates a number of
histograms. It works, but I get an "Invalid Reference" error at each
execution after the first chart is made. I hit the OK button on the
error message and it creates the chart just fine...but kinda annoying
since there could be 100 or so charts, which means 100 or so error
messages.

I pass 3 ranges to the histogram generation code...1) HistData - range
containing the source data, 2) rOutput - range for the output, and 3)
rBins - range containing the bins. These ranges are defined properly
and like I said after the error it goes ahead and properly creates the
chart. So I'm more than a little confused.

I wondered if anyone had ever ran across this....or can see something
wrong with my ranges.

Thanks,
John



Set HistData = SourceData.Range(Cells(StartRow, 2),
Cells(EndRow - 1, 2))

Set rBins = SourceData.Range(Cells(1, 10), Cells(nBins, 10))

LastHist = SourceData.Range(Cells(65532, 12), Cells(65532,
12)).End(xlUp).Row
Set rOutput = SourceData.Range(Cells(LastHist + 3, 12),
Cells(LastHist + 3, 12))
With rOutput.Offset(-1, 0)
.NumberFormat = "00000"
.Value = FocusBINo
End With

'Input Range
'Output sheet name
'Bin Range
'Sorted, Cumulative Percentage, ChartOutput, Labels

Application.Run "ATPVBAEN.XLA!Histogram", _
HistData, _
rOutput, _
rBins, _
False, True, True, False

.



Relevant Pages

  • Re: Histogram Question, Please
    ... Still a bit uncertain re some of the "nuances" of Histograms, ... I call those numbers "bin limits". ... None that I can see with the XL2003 Chart Wizard. ... ing for "excel histogram add-in" without quotes. ...
    (microsoft.public.excel)
  • Re: combining graphs from GD::Graph in one image file
    ... Apologies if this was unclear and sorry for the typo. ... I cannot combine all of my histograms for one dataset into one chart ...
    (comp.lang.perl.modules)
  • Re: combining graphs from GD::Graph in one image file
    ... I cannot combine all of my histograms for one dataset into one chart ... because there will be dozens of them and the output will not be ... That said, AFAIK, GD::Graph doesn't directly support tiling; ... Create each chart as a standalone image. ...
    (comp.lang.perl.modules)