ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Menus (https://www.excelbanter.com/excel-discussion-misc-queries/35330-menus.html)

tkaplan

Menus
 

what would be the VBA to access an excel menu item?


--
tkaplan
------------------------------------------------------------------------
tkaplan's Profile: http://www.excelforum.com/member.php...o&userid=22987
View this thread: http://www.excelforum.com/showthread...hreadid=387192


Bob Phillips

Set ctl = Commandbars("Worksheet Menu
Item").Controls("Tools").Controls("Add-Ins...")

as an example

--

HTH

RP
(remove nothere from the email address if mailing direct)


"tkaplan" wrote in
message ...

what would be the VBA to access an excel menu item?


--
tkaplan
------------------------------------------------------------------------
tkaplan's Profile:

http://www.excelforum.com/member.php...o&userid=22987
View this thread: http://www.excelforum.com/showthread...hreadid=387192




tkaplan


Private Sub Workbook_Open()

Set ctl = CommandBars("Worksheet Menu
Item").Controls("Edit").Controls("Links...")

End Sub

I put this in and it returned an error.

I am trying to go to the menu option: Edit / Links

What am I doing wrong?

Thank you.


--
tkaplan
------------------------------------------------------------------------
tkaplan's Profile: http://www.excelforum.com/member.php...o&userid=22987
View this thread: http://www.excelforum.com/showthread...hreadid=387192


Bob Phillips

Try this instead

Private Sub Workbook_Open()
Dim ctl As CommandBarControl

Set ctl = CommandBars("Worksheet Menu Bar") _
.Controls("Edit").Controls("Links...")

End Sub



--

HTH

RP
(remove nothere from the email address if mailing direct)


"tkaplan" wrote in
message ...

Private Sub Workbook_Open()

Set ctl = CommandBars("Worksheet Menu
Item").Controls("Edit").Controls("Links...")

End Sub

I put this in and it returned an error.

I am trying to go to the menu option: Edit / Links

What am I doing wrong?

Thank you.


--
tkaplan
------------------------------------------------------------------------
tkaplan's Profile:

http://www.excelforum.com/member.php...o&userid=22987
View this thread: http://www.excelforum.com/showthread...hreadid=387192





All times are GMT +1. The time now is 12:34 AM.

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