LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default April Fools

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

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fiscal year - April to March Brian222 Excel Discussion (Misc queries) 0 December 30th 10 10:15 PM
VLOOKUP 1st Friday in April and So On DOUG Excel Discussion (Misc queries) 1 April 8th 10 09:38 PM
Date Format - April error Zane Lassiter Excel Discussion (Misc queries) 1 February 1st 06 02:45 PM
April 1 alaskanrogue (Marc George) Excel Worksheet Functions 5 April 8th 05 05:40 PM
Years when 1 April occurs on a Saturday R B Excel Worksheet Functions 5 November 6th 04 10:01 AM


All times are GMT +1. The time now is 02:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"