Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In XL 2007, I'm using CommandBars.GetEnabledMso("Redo") to determine if the
Ribbon control "Redo" is enabled and it returns True or False accurately. However CommandBars.GetEnabledMso("Undo") always returns True. I've googled this but don't see any mention. Does anybody know how to make it work. Thanks, Doug |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
However CommandBars.GetEnabledMso("Undo") always returns True.
That's not exactly true. When you start Excel 2007 it is False and after a Save it is also False. Ditto after running a macro that changes a cell. In other words it seems to be fine. I'd guess you're mislead by it returning True most of the time. That's because it is available most of the time. For instance if you do an undo, undo is still available (to undo the undo). -- Jim "Doug Glancy" wrote in message ... In XL 2007, I'm using CommandBars.GetEnabledMso("Redo") to determine if the Ribbon control "Redo" is enabled and it returns True or False accurately. However CommandBars.GetEnabledMso("Undo") always returns True. I've googled this but don't see any mention. Does anybody know how to make it work. Thanks, Doug |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jim,
Thanks for your reply. You've prompted me to dig deeper. It works as you described, just not as stated in Help, which says "Returns True if the control identified by the idMso parameter is enabled." That is not what it's doing. For example, open a workbook and type "Jim". The Ribbon Undo button is enabled and the function returns True. Press the Ribbon's Undo button. The button is now disabled and the function still returns True. At that point pressing Ctrl-Z doesn't undo the undo, but CommandBars.ExecuteMso("Undo") does, so it seems that these functions address the ability to undo the previous action as you described. Interestingly, CommandBars.FindControl(ID:=128).Enabled accurately represents the state of the button, i.e., when the Ribbon Undo button is disabled, it returns False. So I'm using that. For added interest try this. New workbook, enter "Jim" in two cells, in the immediate window do CommandBars.ExecuteMso("Undo") a couple of times, and then try to use the Ribbon Undo button. It seems that this command only undoes the undo even though Help says "Executes the control identified by the idMso parameter." Thanks, Doug "Jim Rech" wrote in message ... However CommandBars.GetEnabledMso("Undo") always returns True. That's not exactly true. When you start Excel 2007 it is False and after a Save it is also False. Ditto after running a macro that changes a cell. In other words it seems to be fine. I'd guess you're mislead by it returning True most of the time. That's because it is available most of the time. For instance if you do an undo, undo is still available (to undo the undo). -- Jim "Doug Glancy" wrote in message ... In XL 2007, I'm using CommandBars.GetEnabledMso("Redo") to determine if the Ribbon control "Redo" is enabled and it returns True or False accurately. However CommandBars.GetEnabledMso("Undo") always returns True. I've googled this but don't see any mention. Does anybody know how to make it work. Thanks, Doug |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You've prompted me to dig deeper.
And you me. There certainly does seem to be a difference between the Undo button on the QAT and the thing ExecuteMso("Undo")executes. That latter thing morphs in the Redo control after a single use. Meaning it does what ExecuteMso("Redo") would do if it existed. I say "if it existed" because ExecuteMso("Redo") seems to always be invalid. -- Jim "Doug Glancy" wrote in message ... | Jim, | | Thanks for your reply. You've prompted me to dig deeper. It works as you | described, just not as stated in Help, which says "Returns True if the | control identified by the idMso parameter is enabled." That is not what | it's doing. | | For example, open a workbook and type "Jim". The Ribbon Undo button is | enabled and the function returns True. Press the Ribbon's Undo button. The | button is now disabled and the function still returns True. At that point | pressing Ctrl-Z doesn't undo the undo, but CommandBars.ExecuteMso("Undo") | does, so it seems that these functions address the ability to undo the | previous action as you described. | | Interestingly, CommandBars.FindControl(ID:=128).Enabled accurately | represents the state of the button, i.e., when the Ribbon Undo button is | disabled, it returns False. So I'm using that. | | For added interest try this. New workbook, enter "Jim" in two cells, in the | immediate window do CommandBars.ExecuteMso("Undo") a couple of times, and | then try to use the Ribbon Undo button. It seems that this command only | undoes the undo even though Help says "Executes the control identified by | the idMso parameter." | | Thanks, | | Doug | | "Jim Rech" wrote in message | ... | However CommandBars.GetEnabledMso("Undo") always returns True. | | That's not exactly true. When you start Excel 2007 it is False and after | a Save it is also False. Ditto after running a macro that changes a cell. | In other words it seems to be fine. I'd guess you're mislead by it | returning True most of the time. That's because it is available most of | the time. For instance if you do an undo, undo is still available (to undo | the undo). | | | -- | Jim | "Doug Glancy" wrote in message | ... | In XL 2007, I'm using CommandBars.GetEnabledMso("Redo") to determine if | the Ribbon control "Redo" is enabled and it returns True or False | accurately. However CommandBars.GetEnabledMso("Undo") always returns | True. I've googled this but don't see any mention. Does anybody know how | to make it work. | | Thanks, | | Doug | | | | | |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jim,
The ExecuteMso("Redo") works for me. And then there is repeat, which seems to act like Ctrl-Y, for repeating formatting. Here's my simple sample: Sub test() '*****type something in A1 CommandBars.ExecuteMso ("Undo") CommandBars.ExecuteMso ("Redo") CommandBars.ExecuteMso ("Undo") CommandBars.ExecuteMso ("Redo") '****type something in A2, make it bold and click back into A1 CommandBars.ExecuteMso ("Repeat") '********everything works up to here and fails on next CommandBars.ExecuteMso ("Undo") CommandBars.ExecuteMso ("Redo") End Sub Doug "Jim Rech" wrote in message ... You've prompted me to dig deeper. And you me. There certainly does seem to be a difference between the Undo button on the QAT and the thing ExecuteMso("Undo")executes. That latter thing morphs in the Redo control after a single use. Meaning it does what ExecuteMso("Redo") would do if it existed. I say "if it existed" because ExecuteMso("Redo") seems to always be invalid. -- Jim "Doug Glancy" wrote in message ... | Jim, | | Thanks for your reply. You've prompted me to dig deeper. It works as you | described, just not as stated in Help, which says "Returns True if the | control identified by the idMso parameter is enabled." That is not what | it's doing. | | For example, open a workbook and type "Jim". The Ribbon Undo button is | enabled and the function returns True. Press the Ribbon's Undo button. The | button is now disabled and the function still returns True. At that point | pressing Ctrl-Z doesn't undo the undo, but CommandBars.ExecuteMso("Undo") | does, so it seems that these functions address the ability to undo the | previous action as you described. | | Interestingly, CommandBars.FindControl(ID:=128).Enabled accurately | represents the state of the button, i.e., when the Ribbon Undo button is | disabled, it returns False. So I'm using that. | | For added interest try this. New workbook, enter "Jim" in two cells, in the | immediate window do CommandBars.ExecuteMso("Undo") a couple of times, and | then try to use the Ribbon Undo button. It seems that this command only | undoes the undo even though Help says "Executes the control identified by | the idMso parameter." | | Thanks, | | Doug | | "Jim Rech" wrote in message | ... | However CommandBars.GetEnabledMso("Undo") always returns True. | | That's not exactly true. When you start Excel 2007 it is False and after | a Save it is also False. Ditto after running a macro that changes a cell. | In other words it seems to be fine. I'd guess you're mislead by it | returning True most of the time. That's because it is available most of | the time. For instance if you do an undo, undo is still available (to undo | the undo). | | | -- | Jim | "Doug Glancy" wrote in message | ... | In XL 2007, I'm using CommandBars.GetEnabledMso("Redo") to determine if | the Ribbon control "Redo" is enabled and it returns True or False | accurately. However CommandBars.GetEnabledMso("Undo") always returns | True. I've googled this but don't see any mention. Does anybody know how | to make it work. | | Thanks, | | Doug | | | | | |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The ExecuteMso("Redo") works for me.
And me too now. I tried it have a dozen times before my last post. Don't know how I screwed that up so consistently<g. -- Jim "Doug Glancy" wrote in message ... | Jim, | | The ExecuteMso("Redo") works for me. And then there is repeat, which seems | to act like Ctrl-Y, for repeating formatting. | | Here's my simple sample: | | Sub test() | | '*****type something in A1 | | CommandBars.ExecuteMso ("Undo") | CommandBars.ExecuteMso ("Redo") | CommandBars.ExecuteMso ("Undo") | CommandBars.ExecuteMso ("Redo") | | '****type something in A2, make it bold and click back into A1 | | CommandBars.ExecuteMso ("Repeat") | | '********everything works up to here and fails on next | | CommandBars.ExecuteMso ("Undo") | CommandBars.ExecuteMso ("Redo") | | End Sub | | Doug | | "Jim Rech" wrote in message | ... | You've prompted me to dig deeper. | | And you me. There certainly does seem to be a difference between the Undo | button on the QAT and the thing ExecuteMso("Undo")executes. That latter | thing morphs in the Redo control after a single use. Meaning it does what | ExecuteMso("Redo") would do if it existed. | I say "if it existed" because ExecuteMso("Redo") seems to always be | invalid. | | -- | Jim | "Doug Glancy" wrote in message | ... | | Jim, | | | | Thanks for your reply. You've prompted me to dig deeper. It works as | you | | described, just not as stated in Help, which says "Returns True if the | | control identified by the idMso parameter is enabled." That is not what | | it's doing. | | | | For example, open a workbook and type "Jim". The Ribbon Undo button is | | enabled and the function returns True. Press the Ribbon's Undo button. | The | | button is now disabled and the function still returns True. At that | point | | pressing Ctrl-Z doesn't undo the undo, but | CommandBars.ExecuteMso("Undo") | | does, so it seems that these functions address the ability to undo the | | previous action as you described. | | | | Interestingly, CommandBars.FindControl(ID:=128).Enabled accurately | | represents the state of the button, i.e., when the Ribbon Undo button is | | disabled, it returns False. So I'm using that. | | | | For added interest try this. New workbook, enter "Jim" in two cells, in | the | | immediate window do CommandBars.ExecuteMso("Undo") a couple of times, | and | | then try to use the Ribbon Undo button. It seems that this command only | | undoes the undo even though Help says "Executes the control identified | by | | the idMso parameter." | | | | Thanks, | | | | Doug | | | | "Jim Rech" wrote in message | | ... | | However CommandBars.GetEnabledMso("Undo") always returns True. | | | | That's not exactly true. When you start Excel 2007 it is False and | after | | a Save it is also False. Ditto after running a macro that changes a | cell. | | In other words it seems to be fine. I'd guess you're mislead by it | | returning True most of the time. That's because it is available most | of | | the time. For instance if you do an undo, undo is still available (to | undo | | the undo). | | | | | | -- | | Jim | | "Doug Glancy" wrote in message | | ... | | In XL 2007, I'm using CommandBars.GetEnabledMso("Redo") to determine | if | | the Ribbon control "Redo" is enabled and it returns True or False | | accurately. However CommandBars.GetEnabledMso("Undo") always returns | | True. I've googled this but don't see any mention. Does anybody know | how | | to make it work. | | | | Thanks, | | | | Doug | | | | | | | | | | | | | |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jim,
Maybe you had typed it lower case? It's case-sensitive, I guess due to it's XML roots. Anyways, it was fun talking to you about this. And I'm glad the 2003 commandbars object model is still accessible! Doug "Jim Rech" wrote in message ... The ExecuteMso("Redo") works for me. And me too now. I tried it have a dozen times before my last post. Don't know how I screwed that up so consistently<g. -- Jim "Doug Glancy" wrote in message ... | Jim, | | The ExecuteMso("Redo") works for me. And then there is repeat, which seems | to act like Ctrl-Y, for repeating formatting. | | Here's my simple sample: | | Sub test() | | '*****type something in A1 | | CommandBars.ExecuteMso ("Undo") | CommandBars.ExecuteMso ("Redo") | CommandBars.ExecuteMso ("Undo") | CommandBars.ExecuteMso ("Redo") | | '****type something in A2, make it bold and click back into A1 | | CommandBars.ExecuteMso ("Repeat") | | '********everything works up to here and fails on next | | CommandBars.ExecuteMso ("Undo") | CommandBars.ExecuteMso ("Redo") | | End Sub | | Doug | | "Jim Rech" wrote in message | ... | You've prompted me to dig deeper. | | And you me. There certainly does seem to be a difference between the Undo | button on the QAT and the thing ExecuteMso("Undo")executes. That latter | thing morphs in the Redo control after a single use. Meaning it does what | ExecuteMso("Redo") would do if it existed. | I say "if it existed" because ExecuteMso("Redo") seems to always be | invalid. | | -- | Jim | "Doug Glancy" wrote in message | ... | | Jim, | | | | Thanks for your reply. You've prompted me to dig deeper. It works as | you | | described, just not as stated in Help, which says "Returns True if the | | control identified by the idMso parameter is enabled." That is not what | | it's doing. | | | | For example, open a workbook and type "Jim". The Ribbon Undo button is | | enabled and the function returns True. Press the Ribbon's Undo button. | The | | button is now disabled and the function still returns True. At that | point | | pressing Ctrl-Z doesn't undo the undo, but | CommandBars.ExecuteMso("Undo") | | does, so it seems that these functions address the ability to undo the | | previous action as you described. | | | | Interestingly, CommandBars.FindControl(ID:=128).Enabled accurately | | represents the state of the button, i.e., when the Ribbon Undo button is | | disabled, it returns False. So I'm using that. | | | | For added interest try this. New workbook, enter "Jim" in two cells, in | the | | immediate window do CommandBars.ExecuteMso("Undo") a couple of times, | and | | then try to use the Ribbon Undo button. It seems that this command only | | undoes the undo even though Help says "Executes the control identified | by | | the idMso parameter." | | | | Thanks, | | | | Doug | | | | "Jim Rech" wrote in message | | ... | | However CommandBars.GetEnabledMso("Undo") always returns True. | | | | That's not exactly true. When you start Excel 2007 it is False and | after | | a Save it is also False. Ditto after running a macro that changes a | cell. | | In other words it seems to be fine. I'd guess you're mislead by it | | returning True most of the time. That's because it is available most | of | | the time. For instance if you do an undo, undo is still available (to | undo | | the undo). | | | | | | -- | | Jim | | "Doug Glancy" wrote in message | | ... | | In XL 2007, I'm using CommandBars.GetEnabledMso("Redo") to determine | if | | the Ribbon control "Redo" is enabled and it returns True or False | | accurately. However CommandBars.GetEnabledMso("Undo") always returns | | True. I've googled this but don't see any mention. Does anybody know | how | | to make it work. | | | | Thanks, | | | | Doug | | | | | | | | | | | | | |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
"Undo" in Excel 2007 | Excel Discussion (Misc queries) | |||
change "true" and "false" to "availble" and "out of stock" | Excel Worksheet Functions | |||
Typing "true" excel 2007 change it to "TRUE" | Excel Discussion (Misc queries) | |||
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next | New Users to Excel | |||
IF(VLOOKUP("MYDATA", MYNAME, 4) = 0, "TRUE", "FALSE") | Excel Programming |