LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Using automation to add xy scatter chart

Hi Excel:

I am using a simple macro in Access to create an XY scatter chart in Excel.
It exports out information in a query, puts it in Excel and makes an XY
scatter chart. The problem is that it only charts one axis. When I go into
'Chart Source' in Excel and look at the 'Series' it is only using the Y axis.
But I want it to utilize both columns D and E to symbolize the relationship
between the acres and the price per acre in my data. Any help you can give me
would be greatly appreciated. My code is enclosed.
TIA

Public Function ExportPrice_Acre()

Dim appExcel As Excel.Application
Dim wkbCurr As Excel.Workbook
Dim wksCurr As Excel.Worksheet
Dim chrNew As Excel.Chart

Dim rs As New ADODB.Recordset
Dim lngRows As Long

Set appExcel = New Excel.Application
Set wkbCurr = appExcel.Workbooks.Add
Set wksCurr = wkbCurr.Activesheet
Set chrtnew = appExcel.charts.Add

rs.Open "qryPrice_Acre", CurrentProject.Connection
wksCurr.Name = "Price_Acre"
lngRows = wksCurr.range("a2").copyfromrecordset(rs)
chrtnew.chartwizard wksCurr.range("D2", "E" & lngRows + 1),
gallery:=xlXYScatter, _
HasLegend:=True, Title:="Price per Acre in Cleveland"

appExcel.Visible = True
End Function
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a mix of column and scatter chart on one chart. Matt G[_3_] Charts and Charting in Excel 1 June 17th 09 05:25 AM
Scatter chart displays as line chart Hannu Charts and Charting in Excel 2 July 11th 06 06:37 PM
Chart Automation SteveG Charts and Charting in Excel 2 December 2nd 05 07:48 PM
scatter chart insists on plotting as a line chart Knows too little New Users to Excel 0 March 11th 05 06:37 PM
vc++ automation: opening chart as chart window and setting scale Mike Biolsi Excel Programming 0 February 7th 04 08:13 AM


All times are GMT +1. The time now is 11:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"