I have a charting problem with some VBA code where the problem is the way that Excel assumes every chart created has its data arranged in Columns instead of Rows. As a result, the charts I need to create all end up to have too many data points to work and I get an error telling me that the chart can only have 255 data points. However, if there was an option to select the data in such a way that Excel understood that the data needs to be swapped columns to rows before producing the error then my charting needs would work.
Attached is a spreadsheet that has data from Columns G through NJ that needs to be plotted (there is data on rows 6 and 7 along with rows 65 and 66). There is a macro I recorded to allow the creation and set up of the chart how I need it. When creating the Macro I used a smaller amount data so to not invoke the error and I was able to swap the rows and columns in the Select Data dialog, and this function appears in the VBA code as PlotBy:=xlRows. It was my hope that I could get in front of the error with VBA and set the PlotBy before selecting the full set of data but I cannot seem to find the right VBA code and chart creation methods to achieve this.
Is there some other way to create this chart using VBA and get around the error? I have over 60 charts I need to automation their creation so it needs to be in VBA.
I've tried a number of different code styles from many different sources to create the chart but they all seem not to have large enough data sets to run into this issue.
Bookmarks