|
-
Nov 3rd, 2000, 09:17 AM
#1
I can't figure this out! I NEED to!
I get multiple errors...
the first one is on line 2 type mismatch
xlLine is empty...how do I make vb know that this is the chart type...not a variable.
smae thing on line 4.
Thats as far as I get...
I already:
Code:
Dim O as object
Set O = CreateObject("excel.application")
etc....
Code:
O.Charts.Add 'This works...
O.Activechart.ChartType = xlLine ' ERROR
O.Activechart.SetSourceData Source:=O.Sheets("MarketSmart").Range("F1:G" & MScr), PlotBy:=xlColumns
O.Activechart.Location Where:=xlLocationAsNewSheet, Name:="MS Chart"
With Activechart
.HasTitle = True
.ChartTitle.Characters.Text = "MarketSmart"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Date"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Defects"
End With
O.HasDataTable = False
[b]
Help please......
[b/]
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Nov 3rd, 2000, 09:28 AM
#2
Fanatic Member
xlline
Try replacing xlLine (which is, after all a symbolic constant) with an integer. I am not sure which one you want.
Helpful as a poke in the eye...
Also, could you not get at the Excel constants via Excel itself. Just an idea...
Cheers,
Paul.
Not nearly so tired now...
Haven't been around much so be gentle...
-
Nov 3rd, 2000, 09:40 AM
#3
Fanatic Member
Or just declare the constant before you use it:
Code:
Const xlLine = 4
Const xlLocationAsNewSheet = 1
(it works for me)
[Edited by QWERTY on 11-03-2000 at 09:43 AM]
-
Nov 3rd, 2000, 10:11 AM
#4
How about the others....
So for so good....
Now what about these?
xlCategory?
xlPrimary?
xlValue?
Code:
O.Activechart.Axes(xlCategory, xlPrimary).HasTitle = True
O.Activechart.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Date"
O.Activechart.Axes(xlValue, xlPrimary).HasTitle = True
O.Activechart.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Defects"
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Nov 3rd, 2000, 10:39 AM
#5
ALSO....
xlColumns....?
what number
when I try 2
the columns are reversed..(data needs to be other way)
Thanks
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|