+ Reply to Thread
Results 1 to 3 of 3

Chart Code problem

Hybrid View

  1. #1
    Dan_Green
    Guest

    Chart Code problem

    One of my collegues was running amacroin excel, and came up with a subscript
    error.

    I have tried to figure out what is wrong but my knowledge of VB is somewhat
    limited - can anyone help

    Here is the code

    Kaart = "Chart " & y
    Windows("QC kontrol udsendelse.xls").Activate
    Sheets("Abnormal 1").Select
    ActiveSheet.ChartObjects(Kaart).Activate
    ActiveChart.SeriesCollection(1).Points(z).Select
    With Selection.Border
    .Weight = xlHairline
    .LineStyle = xlNone
    End With

    The Macro stops on the following line

    ActiveChart.SeriesCollection(1).Points(z).Select


    Thanks in advance for any help anyone can offer.

    Rgds,
    Daniel



  2. #2
    Peter T
    Guest

    Re: Chart Code problem

    Hi Daniel,

    Have you assigned a value to z that relates to a point in
    SeriesCollection(1)

    Regards,
    Peter T

    "Dan_Green" <DanGreen@discussions.microsoft.com> wrote in message
    news:E197051E-F27E-4368-ACB2-67182CC01751@microsoft.com...
    > One of my collegues was running amacroin excel, and came up with a

    subscript
    > error.
    >
    > I have tried to figure out what is wrong but my knowledge of VB is

    somewhat
    > limited - can anyone help
    >
    > Here is the code
    >
    > Kaart = "Chart " & y
    > Windows("QC kontrol udsendelse.xls").Activate
    > Sheets("Abnormal 1").Select
    > ActiveSheet.ChartObjects(Kaart).Activate
    > ActiveChart.SeriesCollection(1).Points(z).Select
    > With Selection.Border
    > .Weight = xlHairline
    > .LineStyle = xlNone
    > End With
    >
    > The Macro stops on the following line
    >
    > ActiveChart.SeriesCollection(1).Points(z).Select
    >
    >
    > Thanks in advance for any help anyone can offer.
    >
    > Rgds,
    > Daniel
    >
    >




  3. #3
    Dan_Green
    Guest

    Re: Chart Code problem

    Thanks Peter,


    I have discovered the problem. There was no data for the series in the chart
    - therefore the Macro, couldn't find points(z)

    Rgds

    Daniel


    "Peter T" wrote:

    > Hi Daniel,
    >
    > Have you assigned a value to z that relates to a point in
    > SeriesCollection(1)
    >
    > Regards,
    > Peter T
    >
    > "Dan_Green" <DanGreen@discussions.microsoft.com> wrote in message
    > news:E197051E-F27E-4368-ACB2-67182CC01751@microsoft.com...
    > > One of my collegues was running amacroin excel, and came up with a

    > subscript
    > > error.
    > >
    > > I have tried to figure out what is wrong but my knowledge of VB is

    > somewhat
    > > limited - can anyone help
    > >
    > > Here is the code
    > >
    > > Kaart = "Chart " & y
    > > Windows("QC kontrol udsendelse.xls").Activate
    > > Sheets("Abnormal 1").Select
    > > ActiveSheet.ChartObjects(Kaart).Activate
    > > ActiveChart.SeriesCollection(1).Points(z).Select
    > > With Selection.Border
    > > .Weight = xlHairline
    > > .LineStyle = xlNone
    > > End With
    > >
    > > The Macro stops on the following line
    > >
    > > ActiveChart.SeriesCollection(1).Points(z).Select
    > >
    > >
    > > Thanks in advance for any help anyone can offer.
    > >
    > > Rgds,
    > > Daniel
    > >
    > >

    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1