How do you disable the X button on userforms?
Thanks in advance
Greg
How do you disable the X button on userforms?
Thanks in advance
Greg
Hi Greg, look up QueryClose in VBA Help but this will disable the
X.....
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As
Integer)
Cancel = True
End Sub
Hth,
OJ
perfect thanks again
OJ
Greg
Careful, this will stop you ever closing the form. You need to allow some
function to close it, such as a code triggered close,
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode <> vbFormCode Then
Cancel = True
End If
End Sub
--
HTH
RP
(remove nothere from the email address if mailing direct)
"OJ" <oferns@gmail.com> wrote in message
news:1112258611.849138.85370@z14g2000cwz.googlegroups.com...
> Hi Greg, look up QueryClose in VBA Help but this will disable the
> X.....
>
> Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As
> Integer)
> Cancel = True
> End Sub
>
> Hth,
> OJ
>
that's why I said look it up in help!! I was literally reponding to the
OP...;o)
aaah, but you also said ... but this will disable the X....., and so it
will, and every other close option as well <ebg>
Bob
"OJ" <oferns@gmail.com> wrote in message
news:1112261863.093675.26660@o13g2000cwo.googlegroups.com...
> that's why I said look it up in help!! I was literally reponding to the
> OP...;o)
>
"Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
news:u1nDFTdNFHA.3296@TK2MSFTNGP15.phx.gbl...
> Careful, this will stop you ever closing the form. You need to allow some
> function to close it, such as a code triggered close,
>
> Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
> If CloseMode <> vbFormCode Then
> Cancel = True
> End If
> End Sub
>
> --
>
> HTH
>
> RP
> (remove nothere from the email address if mailing direct)
>
>
> "OJ" <oferns@gmail.com> wrote in message
> news:1112258611.849138.85370@z14g2000cwz.googlegroups.com...
>> Hi Greg, look up QueryClose in VBA Help but this will disable the
>> X.....
>>
>> Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As
>> Integer)
>> Cancel = True
>> End Sub
>>
>> Hth,
>> OJ
>>
>
>
Well I found this more than usefull
Thanks
N10
Hi All
This appears so simple but...... how do you turn off the Excel cell cursor
or at the very least hide it?
--
Cheers
Nigel
"Greg" <laptopgb@ihug.com.au> wrote in message
news:d2gcq2$b9f$1@lust.ihug.co.nz...
> How do you disable the X button on userforms?
>
> Thanks in advance
>
> Greg
>
>
If you protect the worksheet, you can tell excel not to allow the users to
select any cell:
Option Explicit
Sub testme()
Dim wks As Worksheet
Set wks = Worksheets("sheet1")
With wks
.EnableSelection = xlNoSelection
.Protect Password:="hi"
End With
End Sub
Nigel wrote:
>
> Hi All
> This appears so simple but...... how do you turn off the Excel cell cursor
> or at the very least hide it?
>
> --
> Cheers
> Nigel
>
> "Greg" <laptopgb@ihug.com.au> wrote in message
> news:d2gcq2$b9f$1@lust.ihug.co.nz...
> > How do you disable the X button on userforms?
> >
> > Thanks in advance
> >
> > Greg
> >
> >
--
Dave Peterson
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks