Bar Chart thru VBA not working for me . . . RRS feed

  • Question

  • I am using Excel 2010.

    I am not sure what's going on. I create a Bar Chart by hand and it works. I try to do the same thing via VBA code so I can automate it and it does not work. The problem is that the bar's on the chart are greyed out. It's like the chart does not see the data.

    What could be wrong?

    Saturday, October 14, 2017 1:56 PM

All replies

  • Hi General_Fear,

    Please provide your VBA code.
    It would be much better to share your Excel file via cloud storage such as OneDrive, Dropbox, etc, if possible.
    (Remember to modify your private data before sharing.)



    Saturday, October 14, 2017 11:14 PM
  • Hi General_Fear,

    Have you ever set source data for the chart? Just like

        ActiveSheet.Shapes.AddChart2(216, xlBarClustered).Select
        ActiveChart.SetSourceData Source:=Range("Sheet1!$C$15:$I$17")

    If you record the process of creating a Bar Chart by hand and then run the recorded coed, would it work?

    What do you mean bar's on the chart are greyed out? Could you share a screenshot for this?

    Besides, I would suggest you share the VBA code you are using to reproduce your issue.

    Best Regards,


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Monday, October 16, 2017 7:51 AM