Consulting

Results 1 to 13 of 13

Thread: Solved: Can excel disable close button at right corner

  1. #1
    VBAX Regular
    Joined
    Apr 2007
    Posts
    38
    Location

    Solved: Can excel disable close button at right corner

    Can excel disable close button at right corner of user-form

    Thank you

  2. #2
    VBAX Master geekgirlau's Avatar
    Joined
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    1,464
    Location
    AFAIK, no

  3. #3
    VBAX Mentor anandbohra's Avatar
    Joined
    May 2007
    Location
    Mumbai
    Posts
    313
    Location
    the simplest solution

    [VBA]Private Sub Userform_QueryClose(Cancel As Integer, closemode As Integer)
    If closemode = vbFormControlMenu Then
    MsgBox "Sorry you must use Cancel or Exit Button"
    Cancel = True
    End If
    End Sub
    [/VBA]

  4. #4
    VBAX Master geekgirlau's Avatar
    Joined
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    1,464
    Location
    Nice solution - I was looking for a "BeforeClose" or "Close" event; no wonder I didn't find it

  5. #5
    VBAX Mentor anandbohra's Avatar
    Joined
    May 2007
    Location
    Mumbai
    Posts
    313
    Location
    Thanks

    one more but this wont give any message box

    [VBA]Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As _
    Integer)
    If CloseMode = vbFormControlMenu Then Cancel = True
    End Sub
    [/VBA]

  6. #6
    VBAX Regular
    Joined
    Apr 2007
    Posts
    38
    Location

    Very Very Thank you

    Superb !!!!!!

    Very Very Thank you
    Last edited by zv735; 06-04-2007 at 10:16 AM.

  7. #7
    VBAX Tutor
    Joined
    Dec 2006
    Posts
    220
    Location
    If you are interested in a API solution.

    http://www.vbforums.com/showthread.php?t=363931

    Example download included
    "Intellectual passion occurs at the intersection of fact and implication."

    SGB

  8. #8
    VBAX Regular
    Joined
    Apr 2007
    Posts
    38
    Location

    Thank you very much !!!!

    Nice solution : I very Love API Function but i don't know
    Where i can learn about API Function ?

    Thank you very much !!!!

  9. #9
    Administrator
    Chat VP
    VBAX Guru johnske's Avatar
    Joined
    Jul 2004
    Location
    Townsville, Australia
    Posts
    2,872
    Location
    Apart from the curiosity value - why bother?

    APIs are very useful in doing something that'd otherwise be impossible in the container application, but what's the point in going outside the container applications code to use another applications code to perform actions in the container app when the (original) container app already has an inbuilt native function to perform that very same action?

    Taken to the extreme, one could possibly use a very complex set of APIs to replace all of the ordinary visual basic code in a workbook, but then - what's the point?
    You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you

    The major part of getting the right answer lies in asking the right question...


    Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.

  10. #10
    VBAX Tutor
    Joined
    Dec 2006
    Posts
    220
    Location
    Quote Originally Posted by johnske
    Apart from the curiosity value - why bother?
    I have no argument there johnske. But here in the midwest we have a saying. "There is more than one way to skin a Cat"
    "Intellectual passion occurs at the intersection of fact and implication."

    SGB

  11. #11
    Administrator
    Chat VP VBAX Guru johnske's Avatar
    Joined
    Jul 2004
    Location
    Townsville, Australia
    Posts
    2,872
    Location
    Down south here we also have a saying - a cat has nine lives, but only one skin
    You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you

    The major part of getting the right answer lies in asking the right question...


    Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.

  12. #12
    VBAX Tutor
    Joined
    Dec 2006
    Posts
    220
    Location
    Quote Originally Posted by zv735
    Where i can learn about API Function ?
    Here is a list of API functions.

    You can also download the API-Guide.

    http://allapi.mentalis.org/apilist/apilist.php



    "Intellectual passion occurs at the intersection of fact and implication."

    SGB

  13. #13
    VBAX Regular
    Joined
    Apr 2007
    Posts
    38
    Location

    Thanks

    Thank you
    THank you

Posting Permissions

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