Graph colors in excel
Graph colors in excel
Thanks Thanks:  0
Likes Likes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Graph colors in excel

  1. #1
    New Member
    Join Date
    Mar 2002
    Posts
    7
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    I was wondering if you were able to help me find out how to change the color of a graphs bar in Excel. I am using Progress (DataBase software) to populate the worksheet and then using another call to create a chart form the data in the worksheet.

    I have tried using the ColorIndex to change the color of the graph, but failed, any ideas?

  2. #2
    Rest in Peace
    Join Date
    Feb 2002
    Posts
    1,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi Th3_Pu7P


    Did you try recording a macro and studying the code?



  3. #3
    New Member
    Join Date
    Mar 2002
    Posts
    7
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I cannot use a macro as I am using an external program. (i.e. Progress). This is what I have:

    chChart = chExcelApplication:ActiveChart:ChartWizard(chWorksheet3Range, 2, 3, 2, 1, 0, FALSE, "Sales Analysis by Salesman","Saleman" ,"Litreage" ).

    WHERE chChart is the handle that you use in Progress. The above code creates the table.
    I need to do something like this below.
    chChart = chExcelApplication:ActiveChart:Chart:ColorIndex = 2.


  4. #4
    New Member
    Join Date
    Mar 2002
    Posts
    7
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I have compiled the marco and studied the code. It uses the Interior call, but for some reason Progress does not support it
    i.e:

    With Selection.Interior
    .ColorIndex = 1
    .Pattern = xlSolid

  5. #5
    Rest in Peace
    Join Date
    Feb 2002
    Posts
    1,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I am not suggesting you use the recorded macro I'm suggesting you use the code generated to work it out.


    ActiveChart.SeriesCollection(1).Interior.ColorIndex = 27

    Works just fine if the chart is active.

  6. #6
    New Member
    Join Date
    Mar 2002
    Posts
    7
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Dave,
    Yes thanks, I have been looking at the MSDN page and the information for that is there also. I was previously getting errors in Excel when I was making that call, but have fixed that, now the colours are simply not changing. Wierd.

  7. #7
    Rest in Peace
    Join Date
    Feb 2002
    Posts
    1,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    How did you stop the errors

    On error resume next ?

    If so this will only stop the code breaking and you MUST set it back with

    On Error GoTo 0

    Otherwise you will never get any debugs.



  8. #8
    New Member
    Join Date
    Mar 2002
    Posts
    7
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    No, it was communication calls between Progress and Excel. This is the code I have for the colour change, but it is not changing the colour of the bar. I have activated the correct chart.
    chChart = chExcelApplication:ActiveChart:SeriesCollection(1):Interior:ColorIndex = 3.
    Any ideas?

  9. #9
    Rest in Peace
    Join Date
    Feb 2002
    Posts
    1,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    what is the

    "chChart =" at the start for?



  10. #10
    New Member
    Join Date
    Mar 2002
    Posts
    7
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    chChart is the handle that Progress uses to call the functions on this Excel Graph.

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com