Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 788
Default Enable/Disable SAVE AS button from code

Hi,

Can I enable/disable SAVE AS option in OFFICE BUTTON from code ? I
disabled it when my add-in opens during the creation of my custom ribbon (not
from code).

thanks a lot in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Enable/Disable SAVE AS button from code

Instead of using the "enabled' attribute use
getEnabled="nameOfSubInWorkbookReturningEnabledSta te". Then when you want
to change the enabled state invalidate the ribbon.

--
Jim
"chris" wrote in message
...
| Hi,
|
| Can I enable/disable SAVE AS option in OFFICE BUTTON from code ? I
| disabled it when my add-in opens during the creation of my custom ribbon
(not
| from code).
|
| thanks a lot in advance.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 788
Default Enable/Disable SAVE AS button from code

The ribbon becomes invisible when my add-in will close, but SAVE AS remain
disabled. In previous office it was very easy to make it enabled, in 2007,
it's different.

"Jim Rech" wrote:

Instead of using the "enabled' attribute use
getEnabled="nameOfSubInWorkbookReturningEnabledSta te". Then when you want
to change the enabled state invalidate the ribbon.

--
Jim
"chris" wrote in message
...
| Hi,
|
| Can I enable/disable SAVE AS option in OFFICE BUTTON from code ? I
| disabled it when my add-in opens during the creation of my custom ribbon
(not
| from code).
|
| thanks a lot in advance.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Enable/Disable SAVE AS button from code

but SAVE AS remain | disabled.

When you close a workbook or add-in that has embedded RibbonX, the ribbon
customizations should disappear, including disables. If you have an example
where this doesn't happen I'd like to see it as it would be a bug.

--
Jim
"chris" wrote in message
...
| The ribbon becomes invisible when my add-in will close, but SAVE AS remain
| disabled. In previous office it was very easy to make it enabled, in 2007,
| it's different.
|
| "Jim Rech" wrote:
|
| Instead of using the "enabled' attribute use
| getEnabled="nameOfSubInWorkbookReturningEnabledSta te". Then when you
want
| to change the enabled state invalidate the ribbon.
|
| --
| Jim
| "chris" wrote in message
| ...
| | Hi,
| |
| | Can I enable/disable SAVE AS option in OFFICE BUTTON from code ? I
| | disabled it when my add-in opens during the creation of my custom
ribbon
| (not
| | from code).
| |
| | thanks a lot in advance.
|
|
|


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 788
Default Enable/Disable SAVE AS button from code

Sorry Jim, my mistake. I didn't know about this characteristic of embedded
Ribbons, disabling it would undo the changes done in Excel menus. It seems I
closed add-in and opened workbook also, that's why SAVE AS was still disabled.

I used the code below. What should the type of my variable for the macro
procedure MNU_show_Ufr_Save_AS2 ?

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
<commands

<!-- Disable Save As in the Office button menu--
<command idMso="FileSaveAsMenu" enabled = "false"/
<command idMso="FileSaveAs" onAction="MNU_show_Ufr_Save_AS2" /

</commands


Public Sub MNU_show_Ufr_Save_AS2(ByVal control As ............)


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Enable/Disable SAVE AS button from code

What should the type of my variable for the macro procedure
MNU_show_Ufr_Save_AS2 ?


This is the callback signature for a button:

Sub MNU_show_Ufr_Save_AS2(control as IRibbonControl, ByRef cancelDefault)

End Sub

One way to get this is buried in this article:

http://msdn2.microsoft.com/en-us/library/aa722523.aspx

Another way that's easier is to use the Custom UI Editor:

http://openxmldeveloper.org/articles...muieditor.aspx

After you load your ribbonx into it just click the last button to generate
all its callbacks.

--
Jim
"chris" wrote in message
...
| Sorry Jim, my mistake. I didn't know about this characteristic of embedded
| Ribbons, disabling it would undo the changes done in Excel menus. It seems
I
| closed add-in and opened workbook also, that's why SAVE AS was still
disabled.
|
| I used the code below. What should the type of my variable for the macro
| procedure MNU_show_Ufr_Save_AS2 ?
|
| <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
| <commands
|
| <!-- Disable Save As in the Office button menu--
| <command idMso="FileSaveAsMenu" enabled = "false"/
| <command idMso="FileSaveAs" onAction="MNU_show_Ufr_Save_AS2" /
|
| </commands
|
|
| Public Sub MNU_show_Ufr_Save_AS2(ByVal control As ............)


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 788
Default Enable/Disable SAVE AS button from code

Thanks a lot, Jim !!! for your help.

"Jim Rech" wrote:

What should the type of my variable for the macro procedure
MNU_show_Ufr_Save_AS2 ?


This is the callback signature for a button:

Sub MNU_show_Ufr_Save_AS2(control as IRibbonControl, ByRef cancelDefault)

End Sub

One way to get this is buried in this article:

http://msdn2.microsoft.com/en-us/library/aa722523.aspx

Another way that's easier is to use the Custom UI Editor:

http://openxmldeveloper.org/articles...muieditor.aspx

After you load your ribbonx into it just click the last button to generate
all its callbacks.

--
Jim
"chris" wrote in message
...
| Sorry Jim, my mistake. I didn't know about this characteristic of embedded
| Ribbons, disabling it would undo the changes done in Excel menus. It seems
I
| closed add-in and opened workbook also, that's why SAVE AS was still
disabled.
|
| I used the code below. What should the type of my variable for the macro
| procedure MNU_show_Ufr_Save_AS2 ?
|
| <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
| <commands
|
| <!-- Disable Save As in the Office button menu--
| <command idMso="FileSaveAsMenu" enabled = "false"/
| <command idMso="FileSaveAs" onAction="MNU_show_Ufr_Save_AS2" /
|
| </commands
|
|
| Public Sub MNU_show_Ufr_Save_AS2(ByVal control As ............)



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
enable/disable button based on cell value Shoney Excel Discussion (Misc queries) 3 January 9th 08 07:34 PM
Enable / Disable a button using a macro SapnaT Excel Programming 0 November 26th 04 09:56 AM
how to enable / disable customised button on toolbar tango Excel Programming 0 October 23rd 04 12:19 AM
How to enable/disable a button. Polly[_3_] Excel Programming 2 May 28th 04 04:24 AM
Enable/Disable Button surplusbc[_6_] Excel Programming 1 February 1st 04 09:53 PM


All times are GMT +1. The time now is 01:51 AM.

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

About Us

"It's about Microsoft Excel"