Solved

xlLabelPositionBestFit for Bubble Chart in Excel

Posted on 2012-03-20
3
1,099 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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 …
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

732 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