?
Solved

chart object, pop up the "Format Axis" dialog

Posted on 2008-10-10
12
Medium Priority
?
529 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 1600 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
Industry Leaders: 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 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 400 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

649 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