Hello to all.
I have a xls file (2003) containing macro's that is used in excel 2013.
It works well on all pc but not in one and I don't know why.
The problem is with the following function that is called from from another proc without any parameter (it returns AAMenu ).
I'm getting error 5 (Run-time error '5' Invalid procedure call or argument) when try to Set AAMenu(i).
Did someone has the same problem or if someone can help, he ou she is welcome.
Function getAACommandBars(Optional MenuName As String = "&Start") As Variant
Dim i As Integer, AAMenu(2) As CommandBarControl, AAMenuName As Variant
ReDim AAMenuName(2)
AAMenuName = Array("Menu AA", "Worksheet Menu Bar", "Chart Menu Bar")
For i = 0 To UBound(AAMenuName)
Set AAMenu(i) = Application.CommandBars(AAMenuName(i)).Controls(MenuName)
Next
getMBSCommandBars = AAMenu
end Function
I copied the xls file that is working to the pc where it's not working (XLSTART)
Thank you.
Chris
Bookmarks