Solved

xlXYScatterSmooth

Posted on 2007-03-29
5
1,157 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Using "ScreenUpdating" 6 84
Getting warning: You are about to delete 1 row(s) 9 54
Error when passing an argument to a vb6 that contains  '/' 7 46
Hide vba in gp 7 118
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…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

726 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