1 Answers
A:
If you want to add a custom menu item purely using VBA (without manual customization), here’s a simple code snippet:
Sub AddCustomMenuItem()
Dim myMenu As CommandBar
Dim myButton As CommandBarButton
Set myMenu = Application.CommandBars("Tools")
Set myButton = myMenu.Controls.Add(Type:=msoControlButton)
With myButton
.Caption = "Run My Macro"
.OnAction = "MyMacro" ' Replace MyMacro with your actual macro name
End With
End Sub
Autodesk Inventor
AutodeskHelp the community
Be the First to Answer these questions
Disclaimer
Techjockey’s software industry experts offer advice for educational and informational purposes only. A category or product query or issue posted, created, or compiled by Techjockey is not meant to replace your independent judgment.
20,000+ Software Listed
Best
Price Guaranteed
Free Expert
Consultation
2M+
Happy Customers