Can excel disable close button at right corner of user-form
Thank you
Can excel disable close button at right corner of user-form
Thank you
AFAIK, no
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]
Nice solution - I was looking for a "BeforeClose" or "Close" event; no wonder I didn't find it
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]
Superb !!!!!!
Very Very Thank you
Last edited by zv735; 06-04-2007 at 10:16 AM.
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
Nice solution : I very Love API Function but i don't know
Where i can learn about API Function ?
Thank you very much !!!!
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.
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"Originally Posted by johnske
"Intellectual passion occurs at the intersection of fact and implication."
SGB
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.
Here is a list of API functions.Originally Posted by zv735
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
Thank you
THank you