ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Cell context menu in XL2007 (https://www.excelbanter.com/excel-programming/442258-cell-context-menu-xl2007.html)

Madiya

Cell context menu in XL2007
 
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

ozgrid.com

Cell context menu in XL2007
 
See this page for example code
http://www.ozgrid.com/VBA/right-click.htm



--
Regards
Dave Hawley
www.ozgrid.com
"Madiya" wrote in message
...
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



Madiya

Cell context menu in XL2007
 
On May 4, 12:07*pm, "ozgrid.com" wrote:
See this page for example codehttp://www.ozgrid.com/VBA/right-click.htm

--
Regards
Dave Hawleywww.ozgrid.com"Madiya" wrote in message

...



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

Bob Phillips[_4_]

Cell context menu in XL2007
 
Madiya,

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

--

HTH

Bob

"Madiya" wrote in message
...
On May 4, 12:07 pm, "ozgrid.com" wrote:
See this page for example codehttp://www.ozgrid.com/VBA/right-click.htm

--
Regards
Dave Hawleywww.ozgrid.com"Madiya" wrote in message

...



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



Madiya

Cell context menu in XL2007
 
On May 4, 2:34*pm, "Bob Phillips" wrote:
Madiya,

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

--

HTH

Bob

"Madiya" wrote in message

...
On May 4, 12:07 pm, "ozgrid.com" wrote:





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


--
Regards
Dave Hawleywww.ozgrid.com"Madiya" wrote in message


...


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

Madiya

Cell context menu in XL2007
 
On May 4, 2:48*pm, Madiya wrote:
On May 4, 2:34*pm, "Bob Phillips" wrote:





Madiya,


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


--


HTH


Bob


"Madiya" wrote in message


...
On May 4, 12:07 pm, "ozgrid.com" wrote:


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


--
Regards
Dave Hawleywww.ozgrid.com"Madiya" wrote in message


....


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


All times are GMT +1. The time now is 12:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com