Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default Simulate click of AutoSum doesn't work in 2007

In the past I have used the following code line to simulate a click of the
"AutoSum" button.

Application.CommandBars("Standard").Controls("&Aut oSum").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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Simulate click of AutoSum doesn't work in 2007

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

--
Jim
"XP" wrote in message
...
| In the past I have used the following code line to simulate a click of the
| "AutoSum" button.
|
| Application.CommandBars("Standard").Controls("&Aut oSum").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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Simulate click of AutoSum doesn't work in 2007

Use this XP

Application.CommandBars.ExecuteMso ("AutoSum")


--

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


"XP" wrote in message ...
In the past I have used the following code line to simulate a click of the
"AutoSum" button.

Application.CommandBars("Standard").Controls("&Aut oSum").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.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Simulate click of AutoSum doesn't work in 2007

Hi Jim

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

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

But yours is working OK


--

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


"Jim Rech" wrote in message ...
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

--
Jim
"XP" wrote in message
...
| In the past I have used the following code line to simulate a click of the
| "AutoSum" button.
|
| Application.CommandBars("Standard").Controls("&Aut oSum").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.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Simulate click of AutoSum doesn't work in 2007

I see now that the menu and autosum have the same value(226)

--

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


"Ron de Bruin" wrote in message ...
Hi Jim

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

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

But yours is working OK


--

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


"Jim Rech" wrote in message ...
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

--
Jim
"XP" wrote in message
...
| In the past I have used the following code line to simulate a click of the
| "AutoSum" button.
|
| Application.CommandBars("Standard").Controls("&Aut oSum").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.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Simulate click of AutoSum doesn't work in 2007

Totally forgot about ExecuteMso, Ron. Thanks.

--
Jim
"Ron de Bruin" wrote in message
...
| Hi Jim
|
| I try this first but it blow
| Application.CommandBars.FindControl(ID:=226).Execu te
|
| So posted this
| Application.CommandBars.ExecuteMso ("AutoSum")
|
| But yours is working OK
|
|
| --
|
| Regards Ron de Bruin
| http://www.rondebruin.nl/tips.htm
|
|
| "Jim Rech" wrote in message
...
| 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
|
| --
| Jim
| "XP" wrote in message
| ...
| | In the past I have used the following code line to simulate a click of
the
| | "AutoSum" button.
| |
| | Application.CommandBars("Standard").Controls("&Aut oSum").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.
|

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Simulate click of AutoSum doesn't work in 2007

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.


--

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


"Jim Rech" wrote in message ...
Totally forgot about ExecuteMso, Ron. Thanks.

--
Jim
"Ron de Bruin" wrote in message
...
| Hi Jim
|
| I try this first but it blow
| Application.CommandBars.FindControl(ID:=226).Execu te
|
| So posted this
| Application.CommandBars.ExecuteMso ("AutoSum")
|
| But yours is working OK
|
|
| --
|
| Regards Ron de Bruin
| http://www.rondebruin.nl/tips.htm
|
|
| "Jim Rech" wrote in message
...
| 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
|
| --
| Jim
| "XP" wrote in message
| ...
| | In the past I have used the following code line to simulate a click of
the
| | "AutoSum" button.
| |
| | Application.CommandBars("Standard").Controls("&Aut oSum").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.
|

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Simulate click of AutoSum doesn't work in 2007

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

--
Jim
"Ron de Bruin" wrote in message
...
| 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.
|
|
| --
|
| Regards Ron de Bruin
| http://www.rondebruin.nl/tips.htm
|
|
| "Jim Rech" wrote in message
...
| Totally forgot about ExecuteMso, Ron. Thanks.
|
| --
| Jim
| "Ron de Bruin" wrote in message
| ...
| | Hi Jim
| |
| | I try this first but it blow
| | Application.CommandBars.FindControl(ID:=226).Execu te
| |
| | So posted this
| | Application.CommandBars.ExecuteMso ("AutoSum")
| |
| | But yours is working OK
| |
| |
| | --
| |
| | Regards Ron de Bruin
| | http://www.rondebruin.nl/tips.htm
| |
| |
| | "Jim Rech" wrote in message
| ...
| | 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
| |
| | --
| | Jim
| | "XP" wrote in message
| | ...
| | | In the past I have used the following code line to simulate a
click of
| the
| | | "AutoSum" button.
| | |
| | | Application.CommandBars("Standard").Controls("&Aut oSum").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.
| |
|

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Simulate click of AutoSum doesn't work in 2007

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


--

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


"Jim Rech" wrote in message ...
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

--
Jim
"Ron de Bruin" wrote in message
...
| 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.
|
|
| --
|
| Regards Ron de Bruin
| http://www.rondebruin.nl/tips.htm
|
|
| "Jim Rech" wrote in message
...
| Totally forgot about ExecuteMso, Ron. Thanks.
|
| --
| Jim
| "Ron de Bruin" wrote in message
| ...
| | Hi Jim
| |
| | I try this first but it blow
| | Application.CommandBars.FindControl(ID:=226).Execu te
| |
| | So posted this
| | Application.CommandBars.ExecuteMso ("AutoSum")
| |
| | But yours is working OK
| |
| |
| | --
| |
| | Regards Ron de Bruin
| | http://www.rondebruin.nl/tips.htm
| |
| |
| | "Jim Rech" wrote in message
| ...
| | 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
| |
| | --
| | Jim
| | "XP" wrote in message
| | ...
| | | In the past I have used the following code line to simulate a
click of
| the
| | | "AutoSum" button.
| | |
| | | Application.CommandBars("Standard").Controls("&Aut oSum").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.
| |
|

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Autosum doesn't work. How do I get column total? BK Excel Discussion (Misc queries) 2 May 20th 10 02:36 PM
Simulate left click... Udd. Excel Programming 2 July 12th 07 05:28 AM
macro doesn't properly record AutoSum (and SendKeys doesn't work) crimsonkng Excel Programming 2 November 21st 06 02:11 PM
Should have ability to right click to accept autosum, not Enter. Spotter21 Excel Worksheet Functions 0 November 10th 05 12:28 AM
Simulate Click Event ben Excel Programming 5 June 9th 05 09:45 PM


All times are GMT +1. The time now is 10:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"