Solved

xlLabelPositionBestFit for Bubble Chart in Excel

Posted on 2012-03-20
3
1,109 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

627 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