Solved

xlXYScatterSmooth

Posted on 2007-03-29
5
1,169 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

690 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