+ Reply to Thread
Results 1 to 9 of 9

X button on userforms

  1. #1
    Greg
    Guest

    X button on userforms

    How do you disable the X button on userforms?

    Thanks in advance

    Greg



  2. #2
    OJ
    Guest

    Re: X button on userforms

    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


  3. #3
    Greg
    Guest

    Re: X button on userforms

    perfect thanks again
    OJ

    Greg



  4. #4
    Bob Phillips
    Guest

    Re: X button on userforms

    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" <[email protected]> wrote in message
    news:[email protected]...
    > 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
    >




  5. #5
    OJ
    Guest

    Re: X button on userforms

    that's why I said look it up in help!! I was literally reponding to the
    OP...;o)


  6. #6
    Bob Phillips
    Guest

    Re: X button on userforms

    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" <[email protected]> wrote in message
    news:[email protected]...
    > that's why I said look it up in help!! I was literally reponding to the
    > OP...;o)
    >




  7. #7
    N10
    Guest

    Re: X button on userforms


    "Bob Phillips" <[email protected]> wrote in message
    news:[email protected]...
    > 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" <[email protected]> wrote in message
    > news:[email protected]...
    >> 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



  8. #8
    Nigel
    Guest

    Re: X button on userforms

    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" <[email protected]> wrote in message
    news:[email protected]...
    > How do you disable the X button on userforms?
    >
    > Thanks in advance
    >
    > Greg
    >
    >




  9. #9
    Dave Peterson
    Guest

    Re: X button on userforms

    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" <[email protected]> wrote in message
    > news:[email protected]...
    > > How do you disable the X button on userforms?
    > >
    > > Thanks in advance
    > >
    > > Greg
    > >
    > >


    --

    Dave Peterson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1