Results 1 to 5 of 5

Thread: ERRORS!! HEeelllppp mee.........

  1. #1

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Unhappy

    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"

  2. #2
    Fanatic Member
    Join Date
    Oct 2000
    Location
    London
    Posts
    1,008

    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...

  3. #3
    Fanatic Member
    Join Date
    Oct 1999
    Location
    MA, USA
    Posts
    523

    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]

  4. #4

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Question 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"

  5. #5

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Unhappy 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
  •  



Click Here to Expand Forum to Full Width