Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

VBA/Excel 97: Datalabel.Position

Posted on 2001-08-16
12
Medium Priority
?
1,047 Views
Last Modified: 2010-07-27
Asking this question from a PC w/o Excel, therefore I can not post my code.

I am beefing up my Excel 97 macro which links labels/textboxes of a chart with a cell. So far so good. I have seen from the VBA Help that there is a 'xlLabelPositionBestFit' constant for the Datalabel, see also http://msdn.microsoft.com/library/default.asp?url=/library/en-us/office97/xhtml/output/F1/D3/S5A6E8.asp.

Besides the Format Label dialog not offering this option, it does not seem to work from inside VBA. Any ideas ?

Will double the points to 200 if there is a solution.

0
Comment
Question by:cri
[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
  • 8
  • 4
12 Comments
 
LVL 17

Expert Comment

by:calacuccia
ID: 6394274
cri,

This is what I get from your URL:

"Page Cannot Be Found

We apologize for any inconvenience, but we have recently redesigned our site, and the page you?re seeking has been either moved ...."

Is this the link you refer too?
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/office97/xhtml/output/F1/D3/S5A575.asp

0
 
LVL 17

Expert Comment

by:calacuccia
ID: 6394281
It must be this one
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/office97/xhtml/output/F1/D3/S5A6E8.asp

It is the point at the end of your URL, which gives bad results. Damn EE.
0
 
LVL 17

Expert Comment

by:calacuccia
ID: 6394353
cri,

What type of chart are you using? It does influence the availability of the DataLabel(s).Position possibilities.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 17

Expert Comment

by:calacuccia
ID: 6394371
If you have a pie chart, it is available, both in plain as VBA excel.
0
 
LVL 13

Author Comment

by:cri
ID: 6396346
calacuccia, I guess this is a combination of my mistake (the point) and the MSKB sometimes needing a refresh.

As for the charts: Most of the times I use XY charts. The strange thing I did not mention yet: I recorded a macro then changed the constant. The macro ran, but nothing seemed to happen regarding the position. In my own Sub(Datapoint is defined by a set command), I get a run time error with xlLabelPositionBestFit but not with 'Left', 'Right', 'Above', 'Below', so I think I can exclude my code.
0
 
LVL 17

Expert Comment

by:calacuccia
ID: 6396969
cri,

I have noticed the same behaviour with all chart types, except the Pie chart and the 'Donut' chart. These 2 seem the only ones that support the xlLabelPositionBestFit position for labels.
0
 
LVL 13

Author Comment

by:cri
ID: 6406025
calacuccia thank you. 100 x 4  points are already yours.

My I may shift the question a bit for the "double" or do you prefer a new question ?
 
Sub HowToAccessDialogReturnValues()
  'Is there a way to access the return values from this dialogbox ?
  'According Help the variables are:
  'x_align, y_align, orient_num, auto_text, auto_size, show_key, show_value, add_indent
  Application.Dialogs(xlDialogFormatText).Show
  ' ?? And now ?  
End Sub
0
 
LVL 17

Accepted Solution

by:
calacuccia earned 800 total points
ID: 6406620
Hi cri,

As far as I have seen up to now, you can only use those arguments to set the values prior to showing the dialog. I am looking, but have not found anything else then this possibility.

In Word, it is possible though:
http://support.microsoft.com/support/kb/articles/Q159/5/47.asp

In Excel, unfortunately, microsoft did not elaborate this part, it seems.

What you can do is play with the arguments, unfortunately, there seem to be no constants, nor named arguments.

What I have been able to do is something like this:

Sub HowToAccessDialogReturnValues()
Dim mDlg As Dialog
 'Is there a way to access the return values from this dialogbox ?
 'According Help the variables are:
 'x_align, y_align, orient_num, auto_text, auto_size, show_key, show_value, add_indent
 Set mDlg = Application.Dialogs(xlDialogFormatText)
 'Trying to use above properties prior to showing the form
 'Arg1 is x_align, Arg2 is y_align, Arg3 is orient_num
 'Arg4 is auto_text, Arg5 is auto_size, Arg6 is show_key
 'Arg7 is show_value, Arg8 is add_indent
 'There seem to be no named constants,
 'in example below, the value 2 for Arg2 will set x_align to center,
 '2 for Arg2, means y_align to center, 3 for Arg3 means orientation up to down
 ' and so on....
 myValue = mDlg.Show(Arg1:=2, Arg2:=2, Arg3:=3, Arg4:=True, Arg5:=True)
 ' ?? And now ?

End Sub

I tried to assign the result of the dialog OK button, to the variable MyValue, but this variable only returns True or False, depending if OK or Cancel has been entered...

Hopefully ... <continued>

calacuccia

0
 
LVL 13

Author Comment

by:cri
ID: 6419845
Calacuccia, I did not forget this question. Time to settle it. Do you want it now or next month ?
0
 
LVL 17

Expert Comment

by:calacuccia
ID: 6421663
cri,

If you are satisfied with the results up to now, please settle it now. Thanks for the offer for next month, but I should make my 3000 points without this.

cheers
calacuccia
0
 
LVL 13

Author Comment

by:cri
ID: 6422920
calacuccia, thank you.

BTW, did not doubt on your _ability_ to get 3000 points per month, but you seem to have cut back your participation drastically.
0
 
LVL 17

Expert Comment

by:calacuccia
ID: 6423157
ThAnks, cri.

I was not pointing towards you doubting my ability, but you doubting my activity ;-)

I might not be participating as visibly as before, but am still reading most of the questions, I'm just kind of focussing on VBA and VB questions, more than the rest.
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

618 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