Hi Tom
I tried it again and still got the same result, am I doing something wrong
below is the code.
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, _
ByVal bRevert As Integer) As Integer
Declare Function DeleteMenu Lib "user32" (ByVal hMenu As Integer, _
ByVal nPosition As Integer, ByVal wFlags As Integer) As Integer
Sub Disable_Control()
Dim X As Integer, hwnd As Long
hwnd = FindWindow("XLMain", Application.Caption)
For X = 1 To 9
'Delete the first menu command and loop until
'all commands are deleted
Call DeleteMenu(GetSystemMenu(hwnd, False), 0, 1024)
Next X
End Sub
Sub RestoreSystemMenu()
Dim hwnd As Long
'get the window handle of the Excel application
hwnd = FindWindow("xlMain", Application.Caption)
'restore system menu to original state
hMenu% = GetSystemMenu(hwnd, 1)
End Sub
Sub Disable_Control2()
Dim X As Integer, hwnd As Long
hwnd = FindWindow("XLMain", Application.Caption)
Call DeleteMenu(GetSystemMenu(FindWindow("xlMain", _
Application.Caption), False), 4, 1024)
Call DeleteMenu(GetSystemMenu(FindWindow("xlMain", _
Application.Caption), False), 3, 1024)
End Sub
Any help would be Greatly Appreciated
Jason