A
affordsol
Hi to all !
I use the following two subs to enable/disable VBE for my users:
Sub DisableVBE()
Application.VBE.MainWindow.Visible = False '// Close ALL windows 1st!
CmdControl 1695, False '// Visual basics Editor
CmdControl 186, False '// Macros...
CmdControl 184, False '// Record New Macro...
CmdControl 1561, False '// View Code
CmdControl 1605, False '// Design Mode
Application.OnDoubleClick = "Dummy"
CommandBars("ToolBar List").Enabled = False
Application.OnKey "%{F11}", "Dummy"
'
CommandBars("Worksheet menu bar").Controls("Format") _
.Controls("Feuille").Enabled = False
CommandBars("Worksheet menu bar").Controls("Outils") _
.Controls("Protection").Enabled = False
End Sub
Sub EnableVBE()
CmdControl 1695, True '// Visual basics Editor
CmdControl 186, True '// Macros...
CmdControl 184, True '// Record New Macro...
CmdControl 1561, True '// View Code
CmdControl 1605, True '// Design Mode
Application.OnDoubleClick = ""
CommandBars("ToolBar List").Enabled = True
'Application.OnKey "%{F11}", ""
Application.OnKey "%{F11}"
'
CommandBars("Worksheet menu bar").Controls("Format") _
.Controls("Feuille").Enabled = True
CommandBars("Worksheet menu bar").Controls("Outils") _
.Controls("Protection").Enabled = True
End Sub
as you can see, these are "localized" for a french version of Excel through
the french words "Feuille" and "Outils"
I might of course write some new lines so as to handle english words
Nevertheless, I believe these quoted words could be replaced by quoted ids
Could anyone let me have these IDs ?
Thanks by advance & regards from Belgium,
Hervé
I use the following two subs to enable/disable VBE for my users:
Sub DisableVBE()
Application.VBE.MainWindow.Visible = False '// Close ALL windows 1st!
CmdControl 1695, False '// Visual basics Editor
CmdControl 186, False '// Macros...
CmdControl 184, False '// Record New Macro...
CmdControl 1561, False '// View Code
CmdControl 1605, False '// Design Mode
Application.OnDoubleClick = "Dummy"
CommandBars("ToolBar List").Enabled = False
Application.OnKey "%{F11}", "Dummy"
'
CommandBars("Worksheet menu bar").Controls("Format") _
.Controls("Feuille").Enabled = False
CommandBars("Worksheet menu bar").Controls("Outils") _
.Controls("Protection").Enabled = False
End Sub
Sub EnableVBE()
CmdControl 1695, True '// Visual basics Editor
CmdControl 186, True '// Macros...
CmdControl 184, True '// Record New Macro...
CmdControl 1561, True '// View Code
CmdControl 1605, True '// Design Mode
Application.OnDoubleClick = ""
CommandBars("ToolBar List").Enabled = True
'Application.OnKey "%{F11}", ""
Application.OnKey "%{F11}"
'
CommandBars("Worksheet menu bar").Controls("Format") _
.Controls("Feuille").Enabled = True
CommandBars("Worksheet menu bar").Controls("Outils") _
.Controls("Protection").Enabled = True
End Sub
as you can see, these are "localized" for a french version of Excel through
the french words "Feuille" and "Outils"
I might of course write some new lines so as to handle english words
Nevertheless, I believe these quoted words could be replaced by quoted ids
Could anyone let me have these IDs ?
Thanks by advance & regards from Belgium,
Hervé