Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Newsgroup Archive
Excel Newsgroups
Excel Programming
Charting in VBA problem
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="jmacclure, post: 6084342"] 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 [/QUOTE]
Verification
Post reply
Forums
Archive
Newsgroup Archive
Excel Newsgroups
Excel Programming
Charting in VBA problem
Top