Solved

xlLabelPositionBestFit for Bubble Chart in Excel

Posted on 2012-03-20
3
1,048 Views
Last Modified: 2012-03-22
When I try to set the datalabels position for a bubble chart to xlLabelPositionBestFit, it always fail with error, "Run-time error '91', Object variable or With block variable not set".

When i replace xlLabelPositionBestFit with xlLabelPositionBelow, xlLabelPositionAbove, xlLabelPositionCenter, it works.  

My bubble chart labels just got so jammed together that i need to find a good way to space them out automatically.

Can anyone advise why the above doesn't work, and if there's a simple way to resolve the bubble chart label spacing problem?

Code segment below:
   Set WorkingSheet = Worksheets(ChartSheetName)
   With WorkingChart.SeriesCollection(1)
        .DataLabels.Select
        Selection.Position = xlLabelPositionBelow
   End With


Many thanks in advance for your advice.

Thanks,
Janice
0
Comment
Question by:janicep
3 Comments
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 250 total points
ID: 37741684
Best fit is not an option, either in VBA or in the UI, for data labels on a bubble chart - it only works on Pie charts as far as I know.

I don't know of any way to automatically space them best - my only suggestion would be that if your chart is that cluttered, it may not be the best choice of chart for the situation.
0
 
LVL 19

Assisted Solution

by:regmigrant
regmigrant earned 250 total points
ID: 37741852
I think xlLabelPositionBestFit is only for Pie charts, the others you have to handle manually

Reg
0
 

Author Closing Comment

by:janicep
ID: 37751909
You've both confirmed what I have suspected.  Thank you!
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The canonical version of this article is on my web site here: http://iconoun.com/articles/collisions/ A companion presentation is available here: http://iconoun.com/articles/collisions/Unicode_Presentation.pdf
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now