Solved

chart object, pop up the "Format Axis" dialog

Posted on 2008-10-10
12
503 Views
Last Modified: 2013-11-28
I have a chart ('Microsoft Graph Chart') on my form. I want users to be able to change the scaling of the X and Y1 and Y2 axes of the chart. They can do this by:
  clicking on the chart
  double clicking again on the chart
  double clicking on the axis to select an axis
  righlt clicking and choose Edit Axis
and then they finally get to the "Format Axis" dialog

This is tedious and not obvious. Is there a way to pop up this Format Axis dialog for any axis by using my own command button? I know how to change the scale with VBA and reset it but I want that pop up dialog for the user so they can do interactively.
Format-axis.jpg
0
Comment
Question by:LukeB
[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
  • 6
  • 3
  • 2
12 Comments
 
LVL 50

Accepted Solution

by:
Dave Brett earned 400 total points
ID: 22690186
In Excel you can run ommandbar execute to pop up the format axis - not a dialog as such but the same outcome is achieved

Cheers

Dave
  ActiveSheet.ChartObjects(1).Activate
     ActiveChart.Axes(xlValue).Select
     Application.CommandBars(48).Controls(1).Execute

Open in new window

0
 
LVL 1

Author Comment

by:LukeB
ID: 22696156
Hi Brett

ok, I am using Access2003. The Excel code you gave does  not work, I get error at the .Selett statement (your second line.). I tried both:
 chart_SWL.axes(1).select
and
 chart_SWL.ActiveChart.axes(1, 1).Select

where chart_SWL is my chart object

 
0
 
LVL 1

Author Comment

by:LukeB
ID: 22696178
PS:

I know how to do this way:
 http://support.microsoft.com/default.aspx?scid=kb;en-us;158938

but I want to have per my initial quetion, pop up that MS Graph 8 axis dialoge ...
0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
LVL 50

Expert Comment

by:Dave Brett
ID: 22709981
Its been 10 years since I opened Access - I will ask Patrick Matthews to take a look

Regards

Dave
0
 
LVL 1

Author Comment

by:LukeB
ID: 22762584
Hi Brett,

Gentle reminder, any success?
0
 
LVL 50

Expert Comment

by:Dave Brett
ID: 22762621
Hi,

No takers ... so I suggest that you ask for the question to be deleted, and then repost it to get it visible again

Regards

Dave
0
 
LVL 74

Assisted Solution

by:Jeffrey Coachman
Jeffrey Coachman earned 100 total points
ID: 22773453
LukeB,

A few things are preventing this from being easy.

- The code must change the form from Form View to Design view.

- The code must Slect the chart

- The code must have a "Trigger" (Form, Toolbar, menubar) that puts the chart in "Edit" mode.

- The code must Select the Axis.

- The code must somehow invoke the Format Axis dialog box.

Each of these things alone will be difficult.

If, as you say, you can change the settings via code, then why not just create a form with all the various options, and present that to the user?

JeffCoachman
0
 
LVL 1

Author Comment

by:LukeB
ID: 22773481
Hi Jeff,

yes, true. But figured if the Excel boffins can do, like Brett shows above that they can, I reckoned the Access boffins can too?

Plus, no sense re-inventing the wheel if avoidable, which is good enough reason!

tx
Luke
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 22777541
LukeB,

Yes, but in Excel there is no real "Design View" to contend with, like there is in Access.

Excel and Access are two different programs with to different Object Models.

For example: In Access you can bring up the "Print" dialog box fairly easilly (DoCmd.RunCommand acCmdPrint).
Because you are running the code while the form is in Form View.

If you are Viewing the form, the Graph Format Axis dialog box can only be accessed:
a. When the form is in Design view.
b. When the Chart itself is in "Edit" mode.

This is not the same situation you have in Excel.

So you may have "Reckoned" prematurely.
;-)

Now, I don't doubt that if you are willing to dedicate the time and energy to this, it can be done, I merely stated that it would not be "Easy"

;-)

JeffCoachman
0
 
LVL 1

Author Comment

by:LukeB
ID: 22781631
Jeff

Yes, ok. Thought would be easy, oh well. On the other hand, I don't really want users to be changing anything on the axis other than allowing a rescalling. Like don't want them changing the font,  line style , colour, etc

tx, Luke
0
 
LVL 1

Author Closing Comment

by:LukeB
ID: 31505155
thanks guys, balance of pts goes to Brett for he did offer a solution that works, albeti only for Excel at this point
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

733 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