PC Review


Reply
Thread Tools Rate Thread

Cell context menu in XL2007

 
 
Madiya
Guest
Posts: n/a
 
      4th May 2010
As I understand from various postings in this forum, we can not create
any custom toolbars or icons in xl2007.
But Is it possible to add custom icon to run a macro in cell context
menu (cell right click menu) by a add-in in VB6?
If yes pl point me to a sample code if available.

I am trying to make com addin in vb6 with help of example on Chip's
site and need to provide a button in rightclick menu to users for
accessing the code.

Regards,
Madiya
 
Reply With Quote
 
 
 
 
ozgrid.com
Guest
Posts: n/a
 
      4th May 2010
See this page for example code
http://www.ozgrid.com/VBA/right-click.htm



--
Regards
Dave Hawley
www.ozgrid.com
"Madiya" <(E-Mail Removed)> wrote in message
news:4e2758e2-0f5d-4099-8308-(E-Mail Removed)...
> As I understand from various postings in this forum, we can not create
> any custom toolbars or icons in xl2007.
> But Is it possible to add custom icon to run a macro in cell context
> menu (cell right click menu) by a add-in in VB6?
> If yes pl point me to a sample code if available.
>
> I am trying to make com addin in vb6 with help of example on Chip's
> site and need to provide a button in rightclick menu to users for
> accessing the code.
>
> Regards,
> Madiya


 
Reply With Quote
 
Madiya
Guest
Posts: n/a
 
      4th May 2010
On May 4, 12:07*pm, "ozgrid.com" <d...@ozgrid.com> wrote:
> See this page for example codehttp://www.ozgrid.com/VBA/right-click.htm
>
> --
> Regards
> Dave Hawleywww.ozgrid.com"Madiya" <madiya...@yahoo.co.uk> wrote in message
>
> news:4e2758e2-0f5d-4099-8308-(E-Mail Removed)...
>
>
>
> > As I understand from various postings in this forum, we can not create
> > any custom toolbars or icons in xl2007.
> > But Is it possible to add custom icon to run a macro in cell context
> > menu (cell right click menu) by a add-in in VB6?
> > If yes pl point me to a sample code if available.

>
> > I am trying to make com addin in vb6 with help of example on Chip's
> > site and need to provide a button in rightclick menu to users for
> > accessing the code.

>
> > Regards,
> > Madiya- Hide quoted text -

>
> - Show quoted text -


Well, Thanks.
I know this part of code.
I requested sample code for use in com add-in.
I have tried saveral combinations but com add-in is not creating the
custom button in the cell right click menu.
However, all the functions in the same add-in as provided by chip
works fine.

Regards,
Madiya
 
Reply With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      4th May 2010
Madiya,

Can you post the COM addin code, just the necessary implementation code and
the menu code?

--

HTH

Bob

"Madiya" <(E-Mail Removed)> wrote in message
news:38741129-2167-4e71-95a1-(E-Mail Removed)...
On May 4, 12:07 pm, "ozgrid.com" <d...@ozgrid.com> wrote:
> See this page for example codehttp://www.ozgrid.com/VBA/right-click.htm
>
> --
> Regards
> Dave Hawleywww.ozgrid.com"Madiya" <madiya...@yahoo.co.uk> wrote in message
>
> news:4e2758e2-0f5d-4099-8308-(E-Mail Removed)...
>
>
>
> > As I understand from various postings in this forum, we can not create
> > any custom toolbars or icons in xl2007.
> > But Is it possible to add custom icon to run a macro in cell context
> > menu (cell right click menu) by a add-in in VB6?
> > If yes pl point me to a sample code if available.

>
> > I am trying to make com addin in vb6 with help of example on Chip's
> > site and need to provide a button in rightclick menu to users for
> > accessing the code.

>
> > Regards,
> > Madiya- Hide quoted text -

>
> - Show quoted text -


Well, Thanks.
I know this part of code.
I requested sample code for use in com add-in.
I have tried saveral combinations but com add-in is not creating the
custom button in the cell right click menu.
However, all the functions in the same add-in as provided by chip
works fine.

Regards,
Madiya


 
Reply With Quote
 
Madiya
Guest
Posts: n/a
 
      4th May 2010
On May 4, 2:34*pm, "Bob Phillips" <bob.phill...@somewhere.com> wrote:
> Madiya,
>
> Can you post the COM addin code, just the necessary implementation code and
> the menu code?
>
> --
>
> HTH
>
> Bob
>
> "Madiya" <madiya...@yahoo.co.uk> wrote in message
>
> news:38741129-2167-4e71-95a1-(E-Mail Removed)...
> On May 4, 12:07 pm, "ozgrid.com" <d...@ozgrid.com> wrote:
>
>
>
>
>
> > See this page for example codehttp://www.ozgrid.com/VBA/right-click.htm

>
> > --
> > Regards
> > Dave Hawleywww.ozgrid.com"Madiya" <madiya...@yahoo.co.uk> wrote in message

>
> >news:4e2758e2-0f5d-4099-8308-(E-Mail Removed)...

>
> > > As I understand from various postings in this forum, we can not create
> > > any custom toolbars or icons in xl2007.
> > > But Is it possible to add custom icon to run a macro in cell context
> > > menu (cell right click menu) by a add-in in VB6?
> > > If yes pl point me to a sample code if available.

>
> > > I am trying to make com addin in vb6 with help of example on Chip's
> > > site and need to provide a button in rightclick menu to users for
> > > accessing the code.

>
> > > Regards,
> > > Madiya- Hide quoted text -

>
> > - Show quoted text -

>
> Well, Thanks.
> I know this part of code.
> I requested sample code for use in com add-in.
> I have tried saveral combinations but com add-in is not creating the
> custom button in the cell right click menu.
> However, all the functions in the same add-in *as provided by chip
> works fine.
>
> Regards,
> Madiya- Hide quoted text -
>
> - Show quoted text -


Sure. Here it is.

Connectexcel class module :
'FROM
'http://www.cpearson.com/Excel/CreatingCOMAddIn.aspx

'REFERANCES REQUIRED FOR THIS ADDIN
'C:\Program Files\Common Files\microsoft shared\OFFICE11\MSO.DLL
'C:\Program Files\Office2003\OFFICE11\EXCEL.EXE
'C:\Program Files\Common Files\Designer\MSADDNDR.DLL

Option Explicit
Implements AddInDesignerObjects.IDTExtensibility2


Private Sub IDTExtensibility2_OnAddInsUpdate(custom() As Variant)
' not used but required by Implements.
End Sub

Private Sub IDTExtensibility2_OnBeginShutdown(custom() As Variant)
' not used but required by Implements.
End Sub

Private Sub IDTExtensibility2_OnConnection(ByVal Application As
Object, _
ByVal ConnectMode As AddInDesignerObjects.ext_ConnectMode, _
ByVal AddInInst As Object, custom() As Variant)
''''''''''''''''''''''''''''''
' Called automaticaly when Excel loads the CAI.
''''''''''''''''''''''''''''''
Set XL = Application
Set ThisCAI = AddInInst
Set ExcelEvents = New CExcelEvents
End Sub

Private Sub IDTExtensibility2_OnDisconnection(ByVal RemoveMode As
AddInDesignerObjects.ext_DisconnectMode, custom() As Variant)
''''''''''''''''''''''''''''''
' Called automaticaly when Excel unloads the CAI.
''''''''''''''''''''''''''''''
Set XL = Nothing
Set ThisCAI = Nothing
Set ExcelEvents = Nothing
End Sub

Private Sub IDTExtensibility2_OnStartupComplete(custom() As Variant)
' not used but required by Implements.
End Sub

In Cexcelevents class module ;
Private Sub SetupControls()
''''''''''''''''''''''''''''''''''''''''''''''''''''
' Setup one control. Repeat this code for all other
' user interface elements.
''''''''''''''''''''''''''''''''''''''''''''''''''''

'Set pMenuItem1 = XLApp.CommandBars("CELL").Controls.Add( _
' Type:=msoControlButton, Temporary:=True)
With XLApp.CommandBars("Cell").Controls.Add
With .Add(Temporary:=True)
'With pMenuItem1
.Caption = "excel GSM"
.OnAction = "excel GSM"
.Tag = excelGSM
'.BeginGroup = True
End With
End With
pControlsColl.Add pMenuItem1

End Sub

Private Sub pMenuItem1_Click(ByVal Ctrl As Office.CommandBarButton,
CancelDefault As Boolean)
MsgBox "Menu Item Click From Excel COM Add In"
End Sub
 
Reply With Quote
 
Madiya
Guest
Posts: n/a
 
      6th May 2010
On May 4, 2:48*pm, Madiya <madiya...@yahoo.co.uk> wrote:
> On May 4, 2:34*pm, "Bob Phillips" <bob.phill...@somewhere.com> wrote:
>
>
>
>
>
> > Madiya,

>
> > Can you post the COM addin code, just the necessary implementation codeand
> > the menu code?

>
> > --

>
> > HTH

>
> > Bob

>
> > "Madiya" <madiya...@yahoo.co.uk> wrote in message

>
> >news:38741129-2167-4e71-95a1-(E-Mail Removed)...
> > On May 4, 12:07 pm, "ozgrid.com" <d...@ozgrid.com> wrote:

>
> > > See this page for example codehttp://www.ozgrid.com/VBA/right-click.htm

>
> > > --
> > > Regards
> > > Dave Hawleywww.ozgrid.com"Madiya" <madiya...@yahoo.co.uk> wrote in message

>
> > >news:4e2758e2-0f5d-4099-8308-(E-Mail Removed)....

>
> > > > As I understand from various postings in this forum, we can not create
> > > > any custom toolbars or icons in xl2007.
> > > > But Is it possible to add custom icon to run a macro in cell context
> > > > menu (cell right click menu) by a add-in in VB6?
> > > > If yes pl point me to a sample code if available.

>
> > > > I am trying to make com addin in vb6 with help of example on Chip's
> > > > site and need to provide a button in rightclick menu to users for
> > > > accessing the code.

>
> > > > Regards,
> > > > Madiya- Hide quoted text -

>
> > > - Show quoted text -

>
> > Well, Thanks.
> > I know this part of code.
> > I requested sample code for use in com add-in.
> > I have tried saveral combinations but com add-in is not creating the
> > custom button in the cell right click menu.
> > However, all the functions in the same add-in *as provided by chip
> > works fine.

>
> > Regards,
> > Madiya- Hide quoted text -

>
> > - Show quoted text -

>
> Sure. Here it is.
>
> Connectexcel class module :
> 'FROM
> 'http://www.cpearson.com/Excel/CreatingCOMAddIn.aspx
>
> 'REFERANCES REQUIRED FOR THIS ADDIN
> 'C:\Program Files\Common Files\microsoft shared\OFFICE11\MSO.DLL
> 'C:\Program Files\Office2003\OFFICE11\EXCEL.EXE
> 'C:\Program Files\Common Files\Designer\MSADDNDR.DLL
>
> Option Explicit
> Implements AddInDesignerObjects.IDTExtensibility2
>
> Private Sub IDTExtensibility2_OnAddInsUpdate(custom() As Variant)
> ' not used but required by Implements.
> End Sub
>
> Private Sub IDTExtensibility2_OnBeginShutdown(custom() As Variant)
> ' not used but required by Implements.
> End Sub
>
> Private Sub IDTExtensibility2_OnConnection(ByVal Application As
> Object, _
> * * ByVal ConnectMode As AddInDesignerObjects.ext_ConnectMode, _
> * * ByVal AddInInst As Object, custom() As Variant)
> * * ''''''''''''''''''''''''''''''
> * * ' Called automaticaly when Excel loads the CAI.
> * * ''''''''''''''''''''''''''''''
> * * Set XL = Application
> * * Set ThisCAI = AddInInst
> * * Set ExcelEvents = New CExcelEvents
> End Sub
>
> Private Sub IDTExtensibility2_OnDisconnection(ByVal RemoveMode As
> AddInDesignerObjects.ext_DisconnectMode, custom() As Variant)
> * * ''''''''''''''''''''''''''''''
> * * ' Called automaticaly when Excel unloads the CAI.
> * * ''''''''''''''''''''''''''''''
> * * Set XL = Nothing
> * * Set ThisCAI = Nothing
> * * Set ExcelEvents = Nothing
> End Sub
>
> Private Sub IDTExtensibility2_OnStartupComplete(custom() As Variant)
> ' not used but required by Implements.
> End Sub
>
> In Cexcelevents class module ;
> Private Sub SetupControls()
> * * ''''''''''''''''''''''''''''''''''''''''''''''''''''
> * * ' Setup one control. Repeat this code for all other
> * * ' user interface elements.
> * * ''''''''''''''''''''''''''''''''''''''''''''''''''''
>
> 'Set pMenuItem1 = XLApp.CommandBars("CELL").Controls.Add( _
> ' * * * *Type:=msoControlButton, Temporary:=True)
> With XLApp.CommandBars("Cell").Controls.Add
> * * * *With .Add(Temporary:=True)
> * * * * 'With pMenuItem1
> * * * * .Caption = "excel GSM"
> * * * * .OnAction = "excel GSM"
> * * * * .Tag = excelGSM
> * * * * '.BeginGroup = True
> * * End With
> End With
> pControlsColl.Add pMenuItem1
>
> End Sub
>
> Private Sub pMenuItem1_Click(ByVal Ctrl As Office.CommandBarButton,
> CancelDefault As Boolean)
> * * MsgBox "Menu Item Click From Excel COM Add In"
> End Sub- Hide quoted text -
>
> - Show quoted text -


Pl help.
Madiya
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create a callout box/Context menu for a cell Excel Monkey Microsoft Excel Programming 0 14th Apr 2009 06:06 PM
Add item to 'Cell' context menu with XML (RibbonX) =?Utf-8?B?VmluY2VudF82NjM2?= Microsoft Excel Programming 2 11th Jun 2007 12:49 AM
Context menu of Cell MadDog Microsoft Excel Programming 2 4th Mar 2006 10:30 AM
Context Menu - Microsofts standard file context menu =?Utf-8?B?TWFybg==?= Microsoft C# .NET 0 6th Dec 2004 08:49 PM
override datagrid cell context menu? Michael Wortman Microsoft Dot NET Framework Forms 2 7th Aug 2003 03:42 AM


Features
 

Advertising
 

Newsgroups
 


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