Solved

chart object, pop up the "Format Axis" dialog

Posted on 2008-10-10
12
475 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
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
 
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
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

895 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

15 Experts available now in Live!

Get 1:1 Help Now