+ Reply to Thread
Page 2 of 4 FirstFirst 1234 LastLast
Results 16 to 30 of 54
  1. #16
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003 & 2007 & 2010
    Posts
    10,944

    Re: Unable to connect data markers

    Code:
    Sub MakeData()
    
        Dim rngMinPoints As Range
        Dim rngMaxPoints As Range
        Dim rngMinDollars As Range
        Dim rngMaxDollars As Range
        Dim rngMinPay As Range
        Dim rngMaxPay As Range
        Dim rngOutput As Range
        Dim lngNGrades As Long
        Dim lngIndex As Long
        
        With Worksheets("Pay Grades")
            Set rngMinPay = .Range("C17")
            Set rngMaxPay = .Range("F17")
            lngNGrades = .Range("D16")
            Set rngMinPoints = .Range("B20").Resize(lngNGrades, 1)
            Set rngMaxPoints = rngMinPoints.Offset(0, 2)
            Set rngMinDollars = rngMinPoints.Offset(0, 4)
            Set rngMaxDollars = rngMinPoints.Offset(0, 5)
        End With
        
        Set rngOutput = Worksheets("BoxesScreen7").Range("A1")
        rngOutput.Offset(0, 0).Formula = "='" & rngMinPay.Parent.Name & "'!" & rngMinPay.Address
        rngOutput.Offset(1, 0).Formula = "='" & rngMinPay.Parent.Name & "'!" & rngMinPay.Address
        rngOutput.Offset(1, 1).Formula = "='" & rngMinDollars.Parent.Name & "'!" & rngMinDollars.Cells(1, 1).Address
        rngOutput.Offset(1, 2).Formula = "='" & rngMaxDollars.Parent.Name & "'!" & rngMaxDollars.Cells(1, 1).Address
        For lngIndex = 1 To lngNGrades
            rngOutput.Offset(lngIndex + 1, 0).Formula = "='" & rngMinPoints.Parent.Name & "'!" & rngMinPoints.Cells(lngIndex + 1, 1).Address
            rngOutput.Offset(lngIndex + 1, 1).Formula = "='" & rngMinDollars.Parent.Name & "'!" & rngMinDollars.Cells(lngIndex, 1).Address
            rngOutput.Offset(lngIndex + 1, 2).Formula = "='" & rngMaxDollars.Parent.Name & "'!" & rngMaxDollars.Cells(lngIndex + 1, 1).Address
        Next
        rngOutput.Offset(lngNGrades + 1, 0).Formula = "='" & rngMaxPay.Parent.Name & "'!" & rngMaxPay.Address
        rngOutput.Offset(lngNGrades + 2, 0).Formula = "='" & rngMaxPay.Parent.Name & "'!" & rngMaxPay.Address
        rngOutput.Offset(lngNGrades + 1, 2).Formula = "='" & rngMaxDollars.Parent.Name & "'!" & rngMaxDollars.Cells(lngNGrades, 1).Address
    
        rngOutput.Offset(1, 3).Resize(lngNGrades + 1, 1).FormulaR1C1 = "=RC[-1]-RC[-2]"
        rngOutput.Offset(1, 4).Resize(lngNGrades + 1, 1).FormulaR1C1 = "=RC[-4]-R[-1]C[-4]"
        rngOutput.Offset(1, 5).Resize(lngNGrades + 1, 1).FormulaR1C1 = "=R[1]C[-5]-RC[-5]"
    
    End Sub
    Cheers
    Andy
    www.andypope.info

  2. #17
    Forum Contributor
    Join Date
    06-23-2008
    Posts
    116

    Re: Unable to connect data markers

    Thanks Andy I will try it out.

  3. #18
    Forum Contributor
    Join Date
    06-23-2008
    Posts
    116

    Re: Unable to connect data markers

    Hi Andy, your solution worked. Thanks a lot!

    - Ravi

  4. #19
    Forum Contributor
    Join Date
    06-23-2008
    Posts
    116

    Re: Unable to connect data markers

    Hi Andy:


    In the worksheet you posted in this thread (670622.xls), in one instance having a value of zero in B20 seemed to display the following error:

    "Run-time error '1004'
    Unable to set the XValues property of the series class"

    This happened only once and I was not able to replicate the issue using a zero in the referenced cell. Any thoughts? Thanks.

    - Ravi

  5. #20
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003 & 2007 & 2010
    Posts
    10,944

    Re: Unable to connect data markers

    Can you post a workbook that demonstrates the problem
    Cheers
    Andy
    www.andypope.info

  6. #21
    Forum Contributor
    Join Date
    06-23-2008
    Posts
    116

    Re: Unable to connect data markers

    Hi Andy:

    Here is a work sheet with the actual data that caused the run-time error. However, the error did not show up this time. It happened only once. Thanks.

    - Ravi
    Attached Files Attached Files

  7. #22
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003 & 2007 & 2010
    Posts
    10,944

    Re: Unable to connect data markers

    Lets worry about it when the error does appear consistently
    Cheers
    Andy
    www.andypope.info

  8. #23
    Forum Contributor
    Join Date
    06-23-2008
    Posts
    116

    Re: Unable to connect data markers

    Andy:

    I have attached a screen print of the error when it happened. Thanks.

    - Ravi
    Last edited by ravichander; 03-20-2009 at 03:31 PM.

  9. #24
    Forum Contributor
    Join Date
    06-23-2008
    Posts
    116

    Re: Unable to connect data markers

    LOL, OK Andy. I will see if that error surfaces again. Thanks.

    - Ravi

  10. #25
    Forum Contributor
    Join Date
    06-23-2008
    Posts
    116

    Re: Unable to connect data markers

    Quote Originally Posted by Andy Pope View Post
    Lets worry about it when the error does appear consistently
    Hi Andy:

    Here is a situation where the graph was not displayed but came with the same error 1004. Clicking on help said something about macros, which were already enabled to run. In some instance there were messages that said that the worksheet was read only, thus not allowing any changes to be made. This happened on laptops, one with XP, one with Vista, one with 2003 excel one
    with 2007. I don't have a cue as to what might be happening here.

    I have attached the referenced worksheets for your review. Thanks.

    - Ravi
    Last edited by ravichander; 03-20-2009 at 03:31 PM.

  11. #26
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003 & 2007 & 2010
    Posts
    10,944

    Re: Unable to connect data markers

    you passworded the VBA so I can not see anything.

    It throws an error when loading the splash screen.
    It also errors when deleting series, although I don't know why it's deleting series.

    Looks like you need to add some general error trapping into the code to check for certain states, such as no series.
    You may also encounter problems trying to manipulate chart series that have no data.
    Cheers
    Andy
    www.andypope.info

  12. #27
    Forum Contributor
    Join Date
    06-23-2008
    Posts
    116

    Re: Unable to connect data markers

    Quote Originally Posted by Andy Pope View Post
    you passworded the VBA so I can not see anything.
    Sent to you.

    Quote Originally Posted by Andy Pope View Post
    It throws an error when loading the splash screen.
    It also errors when deleting series, although I don't know why it's deleting series.
    I think the deletion was to ensure that only the required number of seriese were created each time.

    Quote Originally Posted by Andy Pope View Post
    Looks like you need to add some general error trapping into the code to check for certain states, such as no series.
    You may also encounter problems trying to manipulate chart series that have no data.
    Noticed that changing the name of the file also produces errors.

    As an aside, any issues with Excel 2007 saved as a xls file on the Vista Operating System? Should I start this topic as a new thread? Thanks Andy.

    - Ravi

  13. #28
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003 & 2007 & 2010
    Posts
    10,944

    Re: Unable to connect data markers

    You need to change the way you reference the chart as currently you are using a name that could change if you created another chart.

    Code:
    Sub ClearExistingSeriesScreen7Graph()
    '
    ' ClearExistingSeriesScreen7Graph Macro
    '
    
    '
        With Sheets("Pay Grades").ChartObjects(1).Chart
            Do While .SeriesCollection.Count > 0
                .SeriesCollection(1).Delete
            Loop
        End With
    
    End Sub
    As for error when the workbook name changes that is because, again, you are using fixed names as the reference.

    so instead of references like this
    Code:
        Windows("CompSoftPhaseII.XLS").Activate
    use
    Code:
    Thisworkbook.Activate
    Cheers
    Andy
    www.andypope.info

  14. #29
    Forum Contributor
    Join Date
    06-23-2008
    Posts
    116

    Re: Unable to connect data markers

    Thanks Andy. Is there a way of globally changing the reference from the specific workbook to ThisWorkBook.Activate?

    Are there any known issues for Excel 2002-07 runing on Vista? Thanks.

    - Ravi

  15. #30
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003 & 2007 & 2010
    Posts
    10,944

    Re: Unable to connect data markers

    Find/Replace

    Charts are completely new in xl2007. Some of the Object model uses new properties. And in places the object model is incomplete.
    I don't think you will find a detailed list it's more a case of try it and see. Then fix the problems.
    Cheers
    Andy
    www.andypope.info

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