Results 1 to 2 of 2

Thread: Excel Chart

  1. #1

    Thread Starter
    eltiT resU motsuC Static's Avatar
    Join Date
    Oct 2000
    Rochester, NY


    O has already been set up as a excel.application
    I keep getting errors with this...
    I created it in the macro of Excel but need it to work in VB

    O.ActiveChart.ChartType = xlLine <-ERROR
    O.ActiveChart.SetSourceData Source:=O.Sheets("MarketSmart").Range("F1:G" & MScr), PlotBy:=xlColumns
    O.ActiveChart.Location here:=xlLocationAsNewSheet, Name:="MS Chart" <-ERROR
    With O.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.ActiveChart.HasDataTable = False

    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  2. #2
    Hyperactive Member
    Join Date
    Nov 2000
    Mexico City
    What´s the error?

    When working with Excel, you´ll have to declare all the constants that are involved. Execute the macro step by step and look for the constants and their value. I used to declare all the constants that I need in a module.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width