View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Robin Hammond Robin Hammond is offline
external usenet poster
 
Posts: 79
Default Popup a Msg to Prevent Code Interruption

Ricky.

1 & 2. Sorry, my mistake. It's frmWait.Show vbmodeless. ie. without the
brackets shown in my original response. Note, you need to be in XL2000 or
higher for this to work.

3. Yes, you can still click on the progress bar cancel button when the macro
is running, which raises an event that ends execution of everything. It's
crude but effective if something is taking too long to run - and could have
unintended consequences if you aren't careful. If you don't want the user to
be able to do that and you are going to use the progress bar class, you can
just add one line which disables the ability to cancel. If you look at the
Demo module in the example workbook the code would then look like this...

PB.Title = "This appears at the top of the bar"
PB.Caption1 = "This appears on the first text line"

PB.DisableCancel = True 'ADDED THIS LINE
PB.Show

I don't think you need to disable the keyboard or mouse.

Hope that helps,

Robin Hammond
www.enhanceddatasystems.com
Check out our XspandXL add-in


"Ricky Pang" wrote in message
...
Thanks Robin,
Three questions.
1) How do you show a custom userform as modeless?
2) I have inserted a Userform, and entered the label as "Please wait
while Macro is Running". But, I get an error message when I incorporate
your code "frmWait.show(vbmodeless)..." So how do I incorporate my
userform into your code?
3) I've also looked into your Progress Bar. It's a good tool. I have
noticed that I could still click while the macro is running. So, what
if disabling the keyboard and mouse function while the macro is running
might be another alternative? How would you disable it?

Much appreciated,
Ricky


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!