View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Harald Staff Harald Staff is offline
external usenet poster
 
Posts: 1,327
Default 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