Programming Excel tru Access

P

Patrice

Hi,

I'd like to know why this line works in an Access module when I speak with
Excel

..
..
With objGra
..
..
..SetSourceData Source:=objSht.Range("A1:E" & intMaxRow + 1), _
PlotBy:=xlColumns

and not this one

..SetSourceData Source:=objSht.Range("A1:A" & intMaxRow + 1 & ", D1:D" _
& intMaxRow + 1), PlotBy:=xlColumns

Thank you

Patrice
 
M

Michel Walsh

Change intMaxRow tom, say, 10, and your last statement results into:


.SetSourceData Source:=objSht.Range("A1:A11, D1:D11"), _
PlotBy:=xlColumns



I am not an expert in Excel, but I doubt that would work, it does, in Excel?
I got an #Name when I tried it, though I have no named range with the *name*
"A1:A11, D1:D11"



Vanderghast, Access MVP
 
R

Ralph

..SetSourceData Source:=objSht.Range(objSht.Cells(1,1),objSht.Cells(" &
intMaxRow + 1 &",5)), PlotBy:=xlColumns
 
P

Patrice

the command works when the columns are in 1 bloc

..SetSourceData Source:=objSht.Range("A1:E75") PlotBy:=xlColumns

but not when the columns are separated

..SetSourceData Source:=objSht.Range("A1:A75, D1:D75") PlotBy:=xlColumns
 
P

Patrice

I changed the , with ; (Juste before D1) and it's work. May be because my
system is in French? I'll check that

Thank you

SetSourceData Source:=objSht.Range("A1:A" & intMaxRow + 1 & ";D1:D" _
& intMaxRow + 1), PlotBy:=xlColumns
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top