Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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" wrote in message
ups.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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default X button on userforms

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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" wrote in message
ups.com...
that's why I said look it up in help!! I was literally reponding to the
OP...;o)



  #5   Report Post  
Posted to microsoft.public.excel.programming
N10 N10 is offline
external usenet poster
 
Posts: 141
Default X button on userforms


"Bob Phillips" wrote in message
...
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" wrote in message
ups.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




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default X button on userforms

How do you disable the X button on userforms?

Thanks in advance

Greg


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default X button on userforms

perfect thanks again
OJ

Greg


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default 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" wrote in message
...
How do you disable the X button on userforms?

Thanks in advance

Greg




  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default 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" wrote in message
...
How do you disable the X button on userforms?

Thanks in advance

Greg



--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
userforms [email protected] Excel Programming 0 February 16th 05 06:48 PM
X button at top right of userforms Todd Huttenstine Excel Programming 2 May 21st 04 02:57 PM
Radio Button Selection in UserForms Big Chris[_32_] Excel Programming 3 February 5th 04 12:26 PM
"minimize" button for userforms Valeria[_2_] Excel Programming 1 January 20th 04 10:16 AM
Form Button with 3 Userforms Help [email protected] Excel Programming 3 November 21st 03 06:00 PM


All times are GMT +1. The time now is 04:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"