ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Testing to see if a Workbook menu item exists (https://www.excelbanter.com/excel-programming/286482-testing-see-if-workbook-menu-item-exists.html)

Todd Huttenstine[_3_]

Testing to see if a Workbook menu item exists
 
Hey guys

What is the code to test to see if the workbook menu item "Import Data"
exists? If it exists, it will be located to the right of the menu item
"Help".

Thanx

Todd Huttenstine



Harald Staff

Testing to see if a Workbook menu item exists
 
Hi Todd

You seem to be busy these days :-)

Function GotMenu(strCapt As String) As Boolean
On Error Resume Next
GotMenu = Len(Application.CommandBars(1).Controls(strCapt).C aption)
End Function

Sub test()
MsgBox GotMenu("File")
MsgBox GotMenu("Import Data")
End Sub

--
HTH. Best wishes Harald
Followup to newsgroup only please

"Todd Huttenstine" skrev i melding
...
Hey guys

What is the code to test to see if the workbook menu item "Import Data"
exists? If it exists, it will be located to the right of the menu item
"Help".

Thanx

Todd Huttenstine





Todd Huttenstine[_3_]

Testing to see if a Workbook menu item exists
 
ha yeah I am busy. THanx for your help.

Todd
"Harald Staff" wrote in message
...
Hi Todd

You seem to be busy these days :-)

Function GotMenu(strCapt As String) As Boolean
On Error Resume Next
GotMenu = Len(Application.CommandBars(1).Controls(strCapt).C aption)
End Function

Sub test()
MsgBox GotMenu("File")
MsgBox GotMenu("Import Data")
End Sub

--
HTH. Best wishes Harald
Followup to newsgroup only please

"Todd Huttenstine" skrev i melding
...
Hey guys

What is the code to test to see if the workbook menu item "Import Data"
exists? If it exists, it will be located to the right of the menu item
"Help".

Thanx

Todd Huttenstine








All times are GMT +1. The time now is 10:22 AM.

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