Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Blocking Access to Sheet
Hi Community !
I have in my initial UserForm the following code to take all the screen: Me.Height = Application.Height Me.Width = Application.Width BUT, I've realized that users can move this UF and change the sheets with all data behind it. Is there any code I can use to "lock" this UserForm? So people cannot move it? Thank yoooou ! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Blocking Access to Sheet
Hi,
This is some code I kept written by Ivan F Moala that disable the option to move a userform Option Explicit Private Declare Function GetSystemMenu Lib "user32" (ByVal hWnd As Long, _ ByVal bRevert As Long) As Long Private Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, _ ByVal nPosition As Long, ByVal wFlags As Long) As Long Private Declare Function FindWindowA Lib "user32" (ByVal lpClassName As String, _ ByVal lpWindowName As String) As Long Private Const MF_BYPOSITION As Long = &H400 Private Sub UserForm_Initialize() Dim lFrmHdl As Long, iCount As Integer lFrmHdl = FindWindowA(vbNullString, Me.Caption) If lFrmHdl < 0 Then For iCount = 0 To 1 RemoveMenu GetSystemMenu(lFrmHdl, False), 0, MF_BYPOSITION Next iCount End If End Sub Mike "Eddie_SP" wrote: Hi Community ! I have in my initial UserForm the following code to take all the screen: Me.Height = Application.Height Me.Width = Application.Width BUT, I've realized that users can move this UF and change the sheets with all data behind it. Is there any code I can use to "lock" this UserForm? So people cannot move it? Thank yoooou ! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Blocking Access to Sheet
you could try
Application.Visible = False remember to set it back to visible when the form closes though If the userform is shown modal, then they can't access any sheets "Eddie_SP" wrote: Hi Community ! I have in my initial UserForm the following code to take all the screen: Me.Height = Application.Height Me.Width = Application.Width BUT, I've realized that users can move this UF and change the sheets with all data behind it. Is there any code I can use to "lock" this UserForm? So people cannot move it? Thank yoooou ! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
protecting sheet blocking comment creation | Excel Discussion (Misc queries) | |||
blocking cells | Excel Worksheet Functions | |||
Blocking VBA Project | Excel Programming | |||
How to overide spell check blocking in protected sheet | Excel Programming | |||
Blocking cells | Excel Programming |