Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / October 2008

Tip: Looking for answers? Try searching our database.

Simulate click of AutoSum doesn't work in 2007

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
XP - 09 Oct 2008 15:55 GMT
In the past I have used the following code line to simulate a click of the
"AutoSum" button.

Application.CommandBars("Standard").Controls("&AutoSum").Execute

This doesn't work in 2007; recording the macro doesn't work either. Anyone
have an equivalent that works in 2007; if so could you please post?

Thanks in advance for your assistance.
Jim Rech - 09 Oct 2008 16:35 GMT
This vintage code still seems to work in Excel 2007.

Sub DoAutoSum()
   Dim x As CommandBarControl
   Set x = CommandBars.FindControl(ID:=226)
   Set x = x.Controls(1)
   x.Execute 'AutoSum
   If Selection.Cells.Count = 1 Then
     x.Execute 'Again to exit edit mode
   End If
End Sub

Signature

Jim

| In the past I have used the following code line to simulate a click of the
| "AutoSum" button.
[quoted text clipped - 5 lines]
|
| Thanks in advance for your assistance.
Ron de Bruin - 09 Oct 2008 16:42 GMT
Hi Jim

I try this first but it blow
Application.CommandBars.FindControl(ID:=226).Execute

So posted this
Application.CommandBars.ExecuteMso ("AutoSum")

But yours is working OK

Signature

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm

> This vintage code still seems to work in Excel 2007.
>
[quoted text clipped - 17 lines]
> |
> | Thanks in advance for your assistance.
Ron de Bruin - 09 Oct 2008 16:54 GMT
I see now that the menu and autosum have the same value(226)

Signature

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm

> Hi Jim
>
[quoted text clipped - 27 lines]
>> |
>> | Thanks in advance for your assistance.
Jim Rech - 09 Oct 2008 20:38 GMT
Totally forgot about ExecuteMso, Ron.  Thanks.

Signature

Jim

| Hi Jim
|
[quoted text clipped - 27 lines]
| > |
| > | Thanks in advance for your assistance.
Ron de Bruin - 09 Oct 2008 20:58 GMT
Hi Jim

Is my answer in this thread "Selective Ribbon miminise" correct
or is there a better way ?

I never wanted to keep the QAT and hide the Ribbon myself so this was my first thought.

Signature

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm

> Totally forgot about ExecuteMso, Ron.  Thanks.
>
[quoted text clipped - 32 lines]
> | > |
> | > | Thanks in advance for your assistance.
Jim Rech - 09 Oct 2008 22:30 GMT
What you posted is the only way I know of to HIDE the ribbon and leave the
QAT.

But he didn't ask that.  He wanted (1) a macro to (2) "disable" the ribbon
and (3) leave the QAT so he can use it for his toolbar.

So I think the answer to his question is "it can't be done".<g>

Signature

Jim

| Hi Jim
|
[quoted text clipped - 39 lines]
| > | > |
| > | > | Thanks in advance for your assistance.
Ron de Bruin - 10 Oct 2008 15:50 GMT
Hi Jim

OK you are right but he can use the buttons he add to the QAT for only that workbook.
It looks like a toolbar then <g>

Have a nice weekend

Signature

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm

> What you posted is the only way I know of to HIDE the ribbon and leave the
> QAT.
[quoted text clipped - 52 lines]
> | > | > |
> | > | > | Thanks in advance for your assistance.
Ron de Bruin - 09 Oct 2008 16:36 GMT
Use this XP

Application.CommandBars.ExecuteMso ("AutoSum")

Signature

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm

> In the past I have used the following code line to simulate a click of the
> "AutoSum" button.
[quoted text clipped - 5 lines]
>
> Thanks in advance for your assistance.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.