Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default userform Enabled property behavior changes between excel 97 and 2000/3

NickHK:

Thanks

The frame idea works, but Application.Interavtive=False, does not
prevent buttons on the userform to be accessed, which is the main
"interface" I was hoping to prevent.

It seems like a bug though, that turning a userform enabled property
to False locks it up forever, even after setting enabled back to True.

Nick D.

On Tue, 19 Sep 2006 14:18:14 +0800, "NickHK"
wrote:

Nicholas,
XL2K.
It does seem there is a problem, as the Local windows correctly reports the
value of Enabled property and it works as expected if you step through the
code, but not if run normally.
Not sure of the cause yet, but what about put all you control in a frame and
disable that instead ?
Or maybe Application.Interactive suits you ?

NickHK

"Nicholas Dreyer" wrote in message
...
I have a lengthy process, call it My Process, started by clicking a
button from a userform.

MyProcess can take a few minutes, and while it's running I want all
excel user interfacing disabled. In excel 97 I simply surrounded the
call to MyProcess in CommandButton_Click(), where CommandButton is the
button on the form that starts the process, with lines like the
following setting the userform Enabled property to False and back to
True again:

Private Sub CommandButton_Click()
Me.Enabled = False
MyProcess
Me.Enabled = True
End Sub

This works fine in excel 97, but in excel 2000 and 2003 excel remains
locked up after exiting CommandButton_CLick and I have to do
<ctrl<Break to regain control of excel again. In order to be
convinced that MyProcess is not interacting in some unexpected way
with excel, it is easy to replicate the situation by creating a simple
userform with one button called CommandButton and the following code:

Private Sub CommandButton_Click()
Me.Enabled = False
Me.Enabled = True
End Sub

One click on CommandButton locks up excel as described above.
<ctrl<break puts you on the line that does the userform.show, and a
check on userform.Enabled at then confirms it is True, even though the
CommandButton remains quite inaccessible.

What am I missing here?

Nick




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
Run time error : Excel 2000 and Excel 2003 : different behavior of Macro Bala[_2_] Excel Programming 2 May 23rd 06 05:15 AM
Change in Link Behavior - Excel 2000 to 2003 David G. Hoch Links and Linking in Excel 0 April 27th 06 04:41 AM
Enabled Property of Shapes? Joe HM Excel Programming 3 March 14th 05 07:18 PM
looping through userform controls changing enabled and locked properties JulieD Excel Programming 2 August 14th 04 12:44 PM
Strange behavior Chart.SeriesCollection(n).Values property Emile van Mierlo Excel Programming 3 June 19th 04 06:07 PM


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

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

About Us

"It's about Microsoft Excel"