PC Review Forums Newsgroups Microsoft Excel Microsoft Excel Charting Move chart in Excel from Access

Reply

Move chart in Excel from Access

 
Thread Tools Rate Thread
Old 06-03-2008, 11:30 AM   #1
justme0010
Guest
 
Posts: n/a
Default Move chart in Excel from Access



I have code that creates a chart in Excel and moves that chart to a
certain sheet. This code works in my home Access 2003 (and Excel 2003),
but not from Access 2000 (and Excel 2000), which I need it to work from.
It just creates and leaves it in the existing "Sheet1." I want it to be
in the existing "ReportCharts." What could be wrong?

The line in question is
..ActiveChart.Location Whe=xlLocationAsObject, Name:="ReportCharts"

The library references seem to be intact in both versions. This is the
full section of code:

With objExcel
..Charts.Add
..ActiveChart.SetSourceData Source:=.Sheets("Chart
Data").Range("A" & intTitleRow & _
":M" & intCurYearRow), _
PlotBy:=xlRows

..ActiveChart.Location Whe=xlLocationAsObject,
Name:="ReportCharts"
With .ActiveChart
..HasTitle = True
..ChartTitle.Characters.Text = Years(i)
..Axes(xlCategory, xlPrimary).HasTitle = True
..Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text =
"MONTH"
..Axes(xlValue, xlPrimary).HasTitle = True
..Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "COST"
..HasDataTable = False
End With
End With




--
justme0010
  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off