Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default RibbonX Customization Question

I have a RibbonX customization for Excel. It's quite simple and it
works fine... But, I'm trying to make the buttons that I have behave
like the controls in Excel such that when there is no Workbook visible
in Excel I want to disable the buttons.

It appears that I want to invalidate my buttons and call the "enabled"
dynamic attribute, but I can't figure out 2 things:

1. How to recognize that the Excel Workspace has no visible
Workbooks, and
2. Where to put the code the will recognize when a Workbook has been
closed or hidden so that I can do the test in #1 and respond
accordingly.

Thanks for the help!!



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default RibbonX Customization Question

You probably need an add-in loaded that has an application events class
module (look for events on http://cpearson.com). Whenever the workbook_open,
_close, _activate, and _deactivate events fire, you need to test for
workbooks.

1. Check for ActiveWorkbook Is Nothing
2. As stated, in an add-in (perhaps the one with the ribbon customization).

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


wrote in message
...
I have a RibbonX customization for Excel. It's quite simple and it
works fine... But, I'm trying to make the buttons that I have behave
like the controls in Excel such that when there is no Workbook visible
in Excel I want to disable the buttons.

It appears that I want to invalidate my buttons and call the "enabled"
dynamic attribute, but I can't figure out 2 things:

1. How to recognize that the Excel Workspace has no visible
Workbooks, and
2. Where to put the code the will recognize when a Workbook has been
closed or hidden so that I can do the test in #1 and respond
accordingly.

Thanks for the help!!





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default RibbonX Customization Question

I like to this in the macro

Very simple

On Error Resume Next
ActiveSheet.Select
If Err.Number 0 Then
MsgBox "There is no workbook open"
Err.Clear
On Error GoTo 0
Else

'Your code


End If


--

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


"Jon Peltier" wrote in message ...
You probably need an add-in loaded that has an application events class
module (look for events on http://cpearson.com). Whenever the workbook_open,
_close, _activate, and _deactivate events fire, you need to test for
workbooks.

1. Check for ActiveWorkbook Is Nothing
2. As stated, in an add-in (perhaps the one with the ribbon customization).

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


wrote in message
...
I have a RibbonX customization for Excel. It's quite simple and it
works fine... But, I'm trying to make the buttons that I have behave
like the controls in Excel such that when there is no Workbook visible
in Excel I want to disable the buttons.

It appears that I want to invalidate my buttons and call the "enabled"
dynamic attribute, but I can't figure out 2 things:

1. How to recognize that the Excel Workspace has no visible
Workbooks, and
2. Where to put the code the will recognize when a Workbook has been
closed or hidden so that I can do the test in #1 and respond
accordingly.

Thanks for the help!!





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
Protected VBA vs RibbonX question tarongazoo Excel Programming 2 January 30th 08 03:09 PM
RibbonX: Problem with OnLoad [email protected] Excel Programming 2 December 28th 07 05:50 PM
Ribbonx - how to create two ribbons? [email protected] Excel Programming 4 December 23rd 07 06:27 PM
About Officemenu(RibbonX) MK Excel Programming 9 April 14th 07 11:34 PM
Extend Excel C API add-in for using RibbonX API Nandan Excel Programming 0 April 10th 07 05:07 PM


All times are GMT +1. The time now is 06:41 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"