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: 8
Default Late Binding for Excel CommandBar and CommandBarControl

Hello,

I have the following piece of code in an Excel .xla add-in:

---------------------------------------------------------------------------------------------------------------------------

Dim MenuBar As CommandBar
Dim MenuItem As CommandBarControl

Application.CommandBars("Worksheet Menu Bar").Controls("New
Menu").Delete
Set MenuBar = Application.CommandBars("Worksheet Menu Bar")
Set MenuItem = MenuBar.Controls.Add(Type:=msoControlPopup)
MenuItem.Caption = "New Menu"

---------------------------------------------------------------------------------------------------------------------------

This works fine when I have the following Reference checked:

Microsoft Office 11.0 Object Library

Since not all people who will be using this .xla will have this version
of the Object Library, I would like to change this from Early Binding
to Late Binding. Unchecking this Reference gives me numerous problems
when I try to run the program.

Can anyone tell me what the corresponding code would be for "Late
Binding"?

Thanks,
Sam.

 
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
Late Binding examples of binding excel application HeatherO Excel Programming 13 March 17th 05 08:19 AM
late binding examples of excel HeatherO[_2_] Excel Programming 1 March 14th 05 08:58 PM
late binding in excel Grey Excel Programming 2 May 24th 04 08:26 AM
late binding in excel Grey Excel Programming 3 May 22nd 04 05:15 PM
EARLY binding or LATE binding ? jason Excel Programming 6 February 26th 04 04:57 PM


All times are GMT +1. The time now is 11:41 PM.

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"