Solved

xlXYScatterSmooth

Posted on 2007-03-29
5
1,140 Views
Last Modified: 2010-08-05
plotting in vb 6.0.. I am having problems at the highlighted line in the code below..I am trying to convert vba code to vb 6.0 code.
is there a possibility of having problems later in the code?

For OutVar = 1 To TotalVariableCount
Set tempchart = FinalWBook.Charts.Add
tempchart.ChartType = xlXYScatterSmooth  <-----------------------------
tempchart.Location Where:=xlLocationAsNewSheet
tempchart.Name = ArraySelectionName(OutVar) & "-" & ArrayVariableName(OutVar)
tempchart.SeriesCollection.NewSeries
'ActiveChart.SeriesCollection.NewSeries
tempchart.SeriesCollection(1).XValues = "=ActualData!R2C1:R" & numberofcells & "C1"
tempchart.SeriesCollection(1).Values = "=ErrorfunctionAll!R" & (OutVar - 1) * ACTUALDATAPOINTS + 2 & "C1:R" & OutVar * ACTUALDATAPOINTS + 1 & "C1"
tempchart.SeriesCollection(1).Name = "=""Actual"""
tempchart.SeriesCollection(2).XValues = "=ActualData!R2C1:R" & numberofcells & "C1"
tempchart.SeriesCollection(2).Values = "=ErrorfunctionAll!R" & (OutVar - 1) * ACTUALDATAPOINTS + 2 & "C2:R" & OutVar * ACTUALDATAPOINTS + 1 & "C2"
tempchart.SeriesCollection(2).Name = "=""sim"""
With tempchart
        .HasTitle = True
        .ChartTitle.Characters.Text = ArraySelectionName(OutVar) & "-" & ArrayVariableName(OutVar)
        .Axes(xlCategory, xlPrimary).HasTitle = True
        .Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "DAYS"
        .Tab.ColorIndex = 6
        .Axes(xlValue, xlPrimary).HasTitle = False
End With
Next OutVar
0
Comment
Question by:Aiysha
5 Comments
 
LVL 26

Accepted Solution

by:
EDDYKT earned 250 total points
ID: 18822474
if you use late binding, vb6 doesn't know any constant value. You need to define this on your module

i.e.
public Const xlXYScatterSmooth = 72
public Const xlLocationAsNewSheet = 1
0
 
LVL 85

Assisted Solution

by:Rory Archibald
Rory Archibald earned 250 total points
ID: 18822997
You will also need:
xlPrimary = 1
xlCategory = 1
xlValue = 2

HTH
Rory
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Problem to skip loop 6 55
Saving history changes to sub form 4 36
Determine Range to Select 5 42
Add a task in Outlook from access 11 35
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

27 Experts available now in Live!

Get 1:1 Help Now