LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default How ignore ribbon code when in Excel 2003

I have a spreadsheet that is to be useable in both Excel 2007 and 2003. In
the 2007 version, there is customized Ribbon support. I have isolated all
the ribbon callback functions in a separate VBA module, and it seems that
when the spreadsheet is opened in Excel 2003 (which of course does not invoke
any of the callback functions) that module is never compiled, and so
everything works.

Except: There is one place where I need to have code that might call one of
the ribbon functions: In a Worksheet_Activate method, I need to invoke the
IRibbonUI.Invalidate method when in 2007. Even though the code can test for
the Application.Version and not call the invalidation procedure, the very
presence of the statement that references that procedure makes VBA want to
compile the module that has ribbon code in it. Of course, that doesn't work
in Excel 2003 -- none of those objects is known.

Is there any way to "trick" VBA in Excel 2003 into allowing code that
references ribbon things to compile. I have no intention of actually calling
or executing any of that code, but I can't figure out how to keep it from
being referenced and thus causing compile errors.

One obvious solution is to change the VBA code itself between the 2007 and
2003 versions of the spreadsheet. But the whole point here is to have a
common set of stuff that works in both places, unchanged.

Thanks,
-don h
--
Don H.
 
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
How to protect excel workbook from macro starting from Developer - Code ribbon? Ivan Excel Programming 3 July 27th 12 06:02 PM
Modifying XLA to show toolbar in XL 2003 and ribbon tab in XL 2007 jean grey Excel Programming 4 January 28th 09 05:14 AM
Assign a Ribbon Control's Label from a Variable in VBA Code jean grey Excel Programming 3 January 27th 09 05:47 AM
Open Workbook Add In with 2007 & 2003, Which Changes Ribbon & Tool RyanH Excel Programming 1 September 30th 08 06:19 PM
Splitting up code ribbon 3e Excel Discussion (Misc queries) 2 June 19th 08 02:07 PM


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