April Fools

  • Thread starter Thread starter Edgar
  • Start date Start date
E

Edgar

Hi

I found a wb last year called menushen which reverses the
text of all excel menus, I thought I would send it to a
few colleagues today for a joke but it isnt working
anymore. It reverses the first menu ie FILE but stops
after that with the error Object doesnt support this
method?

If anyone has time can you let me know whats happening

TIA

Private Sub Workbook_Open()
On Error Resume Next
For Each m1 In Application.CommandBars(1).Controls
m1.Caption = Reverse(m1.Caption)
For Each m2 In m1.Controls
m2.Caption = Reverse(m2.Caption)
For Each m3 In m2.Controls
m3.Caption = Reverse(m3.Caption)
Next m3
Next m2
Next m1
End Sub




Sub ReverseMenuText()
On Error Resume Next
For Each m1 In Application.CommandBars(1).Controls
m1.Caption = Reverse(m1.Caption)
For Each m2 In m1.Controls
m2.Caption = Reverse(m2.Caption)
For Each m3 In m2.Controls
m3.Caption = Reverse(m3.Caption)
Next m3
Next m2
Next m1
End Sub

Sub ResetMenu()
Application.CommandBars(1).Reset
End Sub

Function Reverse(MenuText As String) As String
' Returns menu item, backwards with original hot key
Dim Temp As String, Temp2 As String
Dim ItemLen As Integer, i As Integer
Dim HotKey As String * 1
Dim Found As Boolean

ItemLen = Len(MenuText)
Temp = ""
For i = ItemLen To 1 Step -1
If Mid(MenuText, i, 1) = "&" Then _
HotKey = Mid(MenuText, i + 1, 1) _
Else Temp = Temp & Mid(MenuText, i, 1)
Next i

' Convert reversed string to Proper case
Temp = Application.Proper(Temp)

' Insert & for hot key
Found = False
Temp2 = ""
For i = 1 To ItemLen - 1
If UCase(Mid(Temp, i, 1)) = UCase(HotKey) And Not
Found Then
Temp2 = Temp2 & "&"
Found = True
End If
Temp2 = Temp2 & Mid(Temp, i, 1)
Next i

' Transfer ellipses to end of string
If Left(Temp2, 3) = "..." Then Temp2 = Right(Temp2,
ItemLen - 3) & "..."

Reverse = Temp2
End Function
 
Edgar,

It worked fine for me. Where do you get the error?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Hi

I get the error on the following line - It is very weird
as it worked last time I used it.

For Each m3 In m2.Controls

TIA
 
Edgar said:
Hi

I found a wb last year called menushen which reverses the
text of all excel menus, I thought I would send it to a
few colleagues today for a joke but it isnt working
anymore. It reverses the first menu ie FILE but stops
after that with the error Object doesnt support this
method?

If anyone has time can you let me know whats happening

TIA

It also worked for me and I love it! Looks sort of like a Basque version???
 
Back
Top