Solved

chart object, pop up the "Format Axis" dialog

Posted on 2008-10-10
12
458 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
  • 6
  • 3
  • 2
12 Comments
 
LVL 50

Accepted Solution

by:
Dave Brett earned 400 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 50

Expert Comment

by:Dave Brett
Comment Utility
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
Comment Utility
Hi Brett,

Gentle reminder, any success?
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 50

Expert Comment

by:Dave Brett
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

762 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now