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: 1
Default Charting in VBA problem


I'm trying to create a form code that will make a chart and display i
in the form and am having some trouble with the code for creating th
chart. I am using OfficeXP.

Here is the code section that I am having problems with and the issu
written behind.



Dim myChtObj As ChartObject
Dim myNewSeries1 As Series
Dim myXValues As Range
Dim myYValues1 As Range
Dim myName1 As Range
Dim myName2 As String
Dim myChtTitle As String
Dim myAxisTitle As String

Private Sub cmdShowChart_Click()

Call GetValues 'Gets values, ranges, etc for populating th
chart

Set myChtObj = ActiveSheet.ChartObjects.Add _
(Left:=1000, Width:=528, Top:=100, Height:=282)
Set myNewSeries1 = myChtObj.Chart.SeriesCollection.NewSeries
With myNewSeries1
.Name = myName1
.Values = myYValues1
.XValues = myXValues
.Border.ColorIndex = 11
.Border.Weight = xlThin
.Border.LineStyle = xlContinuous
.MarkerBackgroundColorIndex = 11 ~Get a "Unabl
to set the MarkerBackgroundColorIndex property of the Series class
error
'.MarkerBackgroundColor = 11 ~Trie
this to see if it made a difference - no luck
.MarkerForegroundColorIndex = 11 ~Sam
type of error
.MarkerStyle = xlMarkerStyleDiamond ~Sam
type of error
.MarkerSize = 5
.Smooth = False
~Same type of error
.Shadow = False
.ApplyDataLabels xlDataLabelsShowValue
End With
With myChtObj.Chart
.ChartType = xlLineMarkers
.HasTitle = True
.ChartTitle.Characters.Text = myChtTitle
.HasLegend = False
With .Axes(xlValue, xlPrimary)
.HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text
myAxisTitle ~Object doesn't support this property or method
End With
With .Axes(xlCategory, xlPrimary)
.HasTitle = False
With .TickLabels
.Alignment = xlCenter
.Offset = 100
.ReadingOrder = xlContext
.Orientation = 45
End With
End With
With .PlotArea
.Left = 1
.Top = 24
.Width = 354
.Height = 186
End With
End With
End If

' Save chart as GIF
Fname = ThisWorkbook.Path & Application.PathSeparator & "temp.gif"
~Type Mismatch
myChtObj.Chart.Export Filename:=Fname, FilterName:="GIF"

' Load Image to Form
Image1.Picture = LoadPicture(Fname)



I would appreciate any hel

--
jmacclur
-----------------------------------------------------------------------
jmacclure's Profile: http://www.excelforum.com/member.php...fo&userid=2979
View this thread: http://www.excelforum.com/showthread.php?threadid=49502

 
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
Excel Charting Problem Gemini Excel Discussion (Misc queries) 2 April 14th 08 06:55 PM
CSV Charting Problem Quicksilver2002 Charts and Charting in Excel 1 June 6th 06 06:58 PM
Simple Bar Charting Problem: Would Sure Appreciate Some Help On This Robert11 Charts and Charting in Excel 1 March 9th 06 12:03 AM
Charting Problem Bill[_30_] Excel Programming 0 September 23rd 05 09:57 PM
Charting Problem VBA Jon Peltier[_3_] Excel Programming 0 August 24th 03 03:05 PM


All times are GMT +1. The time now is 01:39 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"