View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bennett[_2_] Bennett[_2_] is offline
external usenet poster
 
Posts: 4
Default (Un)usual "cannot set Xvalues" error message

ARRRGGGHHH!!!

RTFM.

I suspected this but the helpfile confirmed it:

Ranges must contain data when passed to a series. When I read that I
suddenly remembered about a line of code I'd got tucked away that
cleaned up prior to any calculations. At least, it was supposed to be
prior...

Wierdly it was the Y-values that were dataless. I had moved the "write
the data" code to occur before the "reset the worksheet" code.
Basically I was writing the data then deleting it, then trying to graph
it.

Error 1004.

The odd thing was that it was occuring at the .Xvalues point and not
the .Values point, where the error actually was. This is what sent me
off down the wrong path. However, when I moved the code around the
error was solved, so that must have been the reason.. The 95%
confidence interval data was not affected in this way since it has a
separate clean-up procedure.

If this helps anyone all the better I suppose :o) This is important to
watch for because the two chunks of code were in entirely separate
subroutines (they are now combined in one) which made troubleshooting
all that more difficult. Sometimes object-oriented programming isn't
the best way to go ;-)

Cheers

Bennett