View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.charting
doofy[_2_] doofy[_2_] is offline
external usenet poster
 
Posts: 7
Default trying to programmatically change chart data range with vb.net

Jon Peltier wrote:
Well, rows go up to at least 65536, which is twice the largest integer.
Perhaps if you use Longs instead it might work. You could be really
compulsive and use CLng(rowCnt - 1) or whatever vb.net uses for CLng.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"doofy" wrote in message
...
I'm trying to adjust the data range for a chart, based on how many rows of
data have been imported in. The data range will be in the same worksheet
as the chart.

rowEnrolling and rowCnt are integers, but using integers to concat to a
string has been working so far.

Here's my line of code:

ws.ChartObjects(1).chart.seriescollection(1).value s = ws.Range("f" &
rowEnrolling & ":f" & rowCnt - 1)

and I get a "data type mismatch", I'm assuming that the
seriescollection(1).values is not matching the ws.range

Any pointers on this?




I'm only porting over 20 rows at this time, and it should never go over
100. So, I don't think that's the issue, though I could be wrong.

I think it's the syntax and sequencing of the code, though I'm finding
little on the web to help me, and nothing in books I have.