Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Userforms: Disabling - Enabling the X

I have disabled the X in a userform by

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = 0 Then
Cancel = True
UserForm6.Show
End If
End Sub

Which cancels them trying to close the window and redirects then to a
different userform...

Once I have chosen this option in the application once, it does not appear
to run again... it appears that this resets the button to always be
cancelled... How do I enable it so that this macro always runs with the red
X is pressed?

Thx
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Userforms: Disabling - Enabling the X

Do you mean that when you subsequently click X on form #1 it doesn't close
and re-loads form #6? If so, that is inevitable, the code still functions as
before.

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Lauri" wrote in message
...
I have disabled the X in a userform by

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = 0 Then
Cancel = True
UserForm6.Show
End If
End Sub

Which cancels them trying to close the window and redirects then to a
different userform...

Once I have chosen this option in the application once, it does not appear
to run again... it appears that this resets the button to always be
cancelled... How do I enable it so that this macro always runs with the

red
X is pressed?

Thx



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Userforms: Disabling - Enabling the X

That is what I would like to happen. Unfortuanely, once the macro has
opperated once properly (opening form #6) it subsequently does nothing. When
the user pushes the X it does not respond at all.

Do you know why this is happening?

Thanks!

L.

"Bob Phillips" wrote:

Do you mean that when you subsequently click X on form #1 it doesn't close
and re-loads form #6? If so, that is inevitable, the code still functions as
before.

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Lauri" wrote in message
...
I have disabled the X in a userform by

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = 0 Then
Cancel = True
UserForm6.Show
End If
End Sub

Which cancels them trying to close the window and redirects then to a
different userform...

Once I have chosen this option in the application once, it does not appear
to run again... it appears that this resets the button to always be
cancelled... How do I enable it so that this macro always runs with the

red
X is pressed?

Thx




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Userforms: Disabling - Enabling the X

Are you saying the X on form #6 does nothing? If so, there must be code
there that is trapping that event.

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Lauri" wrote in message
...
That is what I would like to happen. Unfortuanely, once the macro has
opperated once properly (opening form #6) it subsequently does nothing.

When
the user pushes the X it does not respond at all.

Do you know why this is happening?

Thanks!

L.

"Bob Phillips" wrote:

Do you mean that when you subsequently click X on form #1 it doesn't

close
and re-loads form #6? If so, that is inevitable, the code still

functions as
before.

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Lauri" wrote in message
...
I have disabled the X in a userform by

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As

Integer)
If CloseMode = 0 Then
Cancel = True
UserForm6.Show
End If
End Sub

Which cancels them trying to close the window and redirects then to a
different userform...

Once I have chosen this option in the application once, it does not

appear
to run again... it appears that this resets the button to always be
cancelled... How do I enable it so that this macro always runs with

the
red
X is pressed?

Thx






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Userforms: Disabling - Enabling the X

No.

the macro is only a private sub in userform 1. However, in Userform1 it
only works once, and when I go back to userform 1 later the X in Userform 1
does nothing. I have to close excel and restart to get the macro to operate
properly again.

There are no subs linked to any of my other X and they are all working like
normal X. I am not sure why after operating once, the button no longer works.

I tried just linking a msg box to the action of pressing the button

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = 0 Then
msgbox "The window is closing"
End If
End Sub

And the same thing happens. The macro only operates once - then the next
time i get around to userform1, if i select the X, nothing happens.

Lauren

"Bob Phillips" wrote:

Are you saying the X on form #6 does nothing? If so, there must be code
there that is trapping that event.

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Lauri" wrote in message
...
That is what I would like to happen. Unfortuanely, once the macro has
opperated once properly (opening form #6) it subsequently does nothing.

When
the user pushes the X it does not respond at all.

Do you know why this is happening?

Thanks!

L.

"Bob Phillips" wrote:

Do you mean that when you subsequently click X on form #1 it doesn't

close
and re-loads form #6? If so, that is inevitable, the code still

functions as
before.

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Lauri" wrote in message
...
I have disabled the X in a userform by

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As

Integer)
If CloseMode = 0 Then
Cancel = True
UserForm6.Show
End If
End Sub

Which cancels them trying to close the window and redirects then to a
different userform...

Once I have chosen this option in the application once, it does not

appear
to run again... it appears that this resets the button to always be
cancelled... How do I enable it so that this macro always runs with

the
red
X is pressed?

Thx






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
enabling/disabling a set of code from within a spreadsheet sheet Roger on Excel Excel Discussion (Misc queries) 2 November 17th 07 05:04 PM
Disabling and re-enabling the AutoFilter from VBA CFD[_6_] Excel Programming 7 October 17th 05 01:43 AM
Help with Enabling / Disabling Menu Items..! Applewine[_2_] Excel Programming 1 June 13th 05 10:37 PM
Disabling/Enabling Macros HRobertson Excel Programming 2 October 24th 03 04:07 PM
Enabling/Disabling Macros David Excel Programming 6 August 12th 03 06:21 PM


All times are GMT +1. The time now is 10:56 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"