PC Review


Reply
Thread Tools Rate Thread

Can I have a temporary message window appear during code execution

 
 
=?Utf-8?B?cm9iczMxMzE=?=
Guest
Posts: n/a
 
      21st Jun 2007
Hi,

I did some searching through prior posts at this site and also looked
through Help in VBA within Excel but wasn't able to find what I need - which
is I'm looking to have a message window popup when a button is clicked on
that is then brought down by the code just after the code execution
completes. Below is what I was hoping to build on -- thanks in advance for
any help you can provide!

Private Sub CommandButton2_Click()

Application.ScreenUpdating = False

MsgBox "Please wait while code executes. This message will " & vbNewLine & _
"automatically close when execution has completed."

Rows("1:1").RowHeight = 60

With Sheets("Transaction Summary")
If .FilterMode = True Then
.ShowAllData
Else
End If
End With

With Sheets("Open Transactions by Member ID")
If .FilterMode = True Then
.ShowAllData
Else
End If
End With

With Sheets("Member ID Report Master")
If Len(.Range("D2")) <> 0 Then
Module1.closedtrans1
Module2.clearmemidtrans
Else
MsgBox "Sales (Member ID Report) transaction data has not yet been
submitted -" & vbNewLine & _
"Sales data must be first submitted prior to requesting to see open"
& vbNewLine & _
"transactions."
End If
End With

With Sheets("Transaction Summary")
If .FilterMode <> True Then
.Rows("1:1").AutoFilter
Else
End If
End With

With Sheets("Open Transactions by Member ID")
If .FilterMode <> True Then
.Rows("1:1").AutoFilter
Else
End If
End With

Application.ScreenUpdating = True

--
Robert
 
Reply With Quote
 
 
 
 
NickHK
Guest
Posts: n/a
 
      21st Jun 2007
MsgBox is modal in nature, so will stop execution until dismissed. Use the
StatusBar or design a userform that you can update with a message and unload
when the routine finishes.

NickHK

"robs3131" <(E-Mail Removed)> wrote in message
news:E31FD45D-3FC3-4F8A-9460-(E-Mail Removed)...
> Hi,
>
> I did some searching through prior posts at this site and also looked
> through Help in VBA within Excel but wasn't able to find what I need -

which
> is I'm looking to have a message window popup when a button is clicked on
> that is then brought down by the code just after the code execution
> completes. Below is what I was hoping to build on -- thanks in advance

for
> any help you can provide!
>
> Private Sub CommandButton2_Click()
>
> Application.ScreenUpdating = False
>
> MsgBox "Please wait while code executes. This message will " & vbNewLine

& _
> "automatically close when execution has completed."
>
> Rows("1:1").RowHeight = 60
>
> With Sheets("Transaction Summary")
> If .FilterMode = True Then
> .ShowAllData
> Else
> End If
> End With
>
> With Sheets("Open Transactions by Member ID")
> If .FilterMode = True Then
> .ShowAllData
> Else
> End If
> End With
>
> With Sheets("Member ID Report Master")
> If Len(.Range("D2")) <> 0 Then
> Module1.closedtrans1
> Module2.clearmemidtrans
> Else
> MsgBox "Sales (Member ID Report) transaction data has not yet been
> submitted -" & vbNewLine & _
> "Sales data must be first submitted prior to requesting to see

open"
> & vbNewLine & _
> "transactions."
> End If
> End With
>
> With Sheets("Transaction Summary")
> If .FilterMode <> True Then
> .Rows("1:1").AutoFilter
> Else
> End If
> End With
>
> With Sheets("Open Transactions by Member ID")
> If .FilterMode <> True Then
> .Rows("1:1").AutoFilter
> Else
> End If
> End With
>
> Application.ScreenUpdating = True
>
> --
> Robert



 
Reply With Quote
 
=?Utf-8?B?cm9iczMxMzE=?=
Guest
Posts: n/a
 
      21st Jun 2007
Thanks Nick.

I figured out how to change the Status Bar, the only issue is that the text
it's too small -- the user may not notice the text.

I also started putting together a userform, but I'm getting stuck on a
couple of items:

1 - I put a text box in the form -- for some reason, even though I set
"WordWrap" to "True", the text does not wrap (I also tried setting the
"Enabled" property of the text box to both "True" and "False", and the
"Enabled property of the Form to "True" and "False" -- I couldn't get to work
for any combination.

2 - The form comes up fine when I call it in my macro, but the form requires
the user to click on the red 'x' for the code to continue. I have code that
hides the form at the end of the macro and that seems to work...it's just the
part of requiring the user to click on the x that I want to automate. Any
ideas? My code is below


Private Sub CommandButton2_Click()

Application.ScreenUpdating = False

With dataprocess 'this is the name of my form
.Show
End With

.........code............

With dataprocess
.Hide
End With

Application.ScreenUpdating = True

End Sub


Thanks!

Robert

--
Robert


"NickHK" wrote:

> MsgBox is modal in nature, so will stop execution until dismissed. Use the
> StatusBar or design a userform that you can update with a message and unload
> when the routine finishes.
>
> NickHK
>
> "robs3131" <(E-Mail Removed)> wrote in message
> news:E31FD45D-3FC3-4F8A-9460-(E-Mail Removed)...
> > Hi,
> >
> > I did some searching through prior posts at this site and also looked
> > through Help in VBA within Excel but wasn't able to find what I need -

> which
> > is I'm looking to have a message window popup when a button is clicked on
> > that is then brought down by the code just after the code execution
> > completes. Below is what I was hoping to build on -- thanks in advance

> for
> > any help you can provide!
> >
> > Private Sub CommandButton2_Click()
> >
> > Application.ScreenUpdating = False
> >
> > MsgBox "Please wait while code executes. This message will " & vbNewLine

> & _
> > "automatically close when execution has completed."
> >
> > Rows("1:1").RowHeight = 60
> >
> > With Sheets("Transaction Summary")
> > If .FilterMode = True Then
> > .ShowAllData
> > Else
> > End If
> > End With
> >
> > With Sheets("Open Transactions by Member ID")
> > If .FilterMode = True Then
> > .ShowAllData
> > Else
> > End If
> > End With
> >
> > With Sheets("Member ID Report Master")
> > If Len(.Range("D2")) <> 0 Then
> > Module1.closedtrans1
> > Module2.clearmemidtrans
> > Else
> > MsgBox "Sales (Member ID Report) transaction data has not yet been
> > submitted -" & vbNewLine & _
> > "Sales data must be first submitted prior to requesting to see

> open"
> > & vbNewLine & _
> > "transactions."
> > End If
> > End With
> >
> > With Sheets("Transaction Summary")
> > If .FilterMode <> True Then
> > .Rows("1:1").AutoFilter
> > Else
> > End If
> > End With
> >
> > With Sheets("Open Transactions by Member ID")
> > If .FilterMode <> True Then
> > .Rows("1:1").AutoFilter
> > Else
> > End If
> > End With
> >
> > Application.ScreenUpdating = True
> >
> > --
> > Robert

>
>
>

 
Reply With Quote
 
Gary Keramidas
Guest
Posts: n/a
 
      21st Jun 2007
i have a userform i display while a report is being processed
label1 is changed depending on which report is being run



sub report()
'dim statements and anything else needed before the report is created


With UserForm10
.Show vbModeless
.Caption = "Fresh Production Data Report"
.Label1 = "Creating Report By Box .........Please Wait"
.BackColor = &H800000
.Label1.ForeColor = &HFFCC99
End With
DoEvents

'create the report

Unload UserForm10

end sub

--


Gary


"robs3131" <(E-Mail Removed)> wrote in message
news:A933EE6A-D166-4181-B8A8-(E-Mail Removed)...
> Thanks Nick.
>
> I figured out how to change the Status Bar, the only issue is that the text
> it's too small -- the user may not notice the text.
>
> I also started putting together a userform, but I'm getting stuck on a
> couple of items:
>
> 1 - I put a text box in the form -- for some reason, even though I set
> "WordWrap" to "True", the text does not wrap (I also tried setting the
> "Enabled" property of the text box to both "True" and "False", and the
> "Enabled property of the Form to "True" and "False" -- I couldn't get to work
> for any combination.
>
> 2 - The form comes up fine when I call it in my macro, but the form requires
> the user to click on the red 'x' for the code to continue. I have code that
> hides the form at the end of the macro and that seems to work...it's just the
> part of requiring the user to click on the x that I want to automate. Any
> ideas? My code is below
>
>
> Private Sub CommandButton2_Click()
>
> Application.ScreenUpdating = False
>
> With dataprocess 'this is the name of my form
> .Show
> End With
>
> ........code............
>
> With dataprocess
> .Hide
> End With
>
> Application.ScreenUpdating = True
>
> End Sub
>
>
> Thanks!
>
> Robert
>
> --
> Robert
>
>
> "NickHK" wrote:
>
>> MsgBox is modal in nature, so will stop execution until dismissed. Use the
>> StatusBar or design a userform that you can update with a message and unload
>> when the routine finishes.
>>
>> NickHK
>>
>> "robs3131" <(E-Mail Removed)> wrote in message
>> news:E31FD45D-3FC3-4F8A-9460-(E-Mail Removed)...
>> > Hi,
>> >
>> > I did some searching through prior posts at this site and also looked
>> > through Help in VBA within Excel but wasn't able to find what I need -

>> which
>> > is I'm looking to have a message window popup when a button is clicked on
>> > that is then brought down by the code just after the code execution
>> > completes. Below is what I was hoping to build on -- thanks in advance

>> for
>> > any help you can provide!
>> >
>> > Private Sub CommandButton2_Click()
>> >
>> > Application.ScreenUpdating = False
>> >
>> > MsgBox "Please wait while code executes. This message will " & vbNewLine

>> & _
>> > "automatically close when execution has completed."
>> >
>> > Rows("1:1").RowHeight = 60
>> >
>> > With Sheets("Transaction Summary")
>> > If .FilterMode = True Then
>> > .ShowAllData
>> > Else
>> > End If
>> > End With
>> >
>> > With Sheets("Open Transactions by Member ID")
>> > If .FilterMode = True Then
>> > .ShowAllData
>> > Else
>> > End If
>> > End With
>> >
>> > With Sheets("Member ID Report Master")
>> > If Len(.Range("D2")) <> 0 Then
>> > Module1.closedtrans1
>> > Module2.clearmemidtrans
>> > Else
>> > MsgBox "Sales (Member ID Report) transaction data has not yet been
>> > submitted -" & vbNewLine & _
>> > "Sales data must be first submitted prior to requesting to see

>> open"
>> > & vbNewLine & _
>> > "transactions."
>> > End If
>> > End With
>> >
>> > With Sheets("Transaction Summary")
>> > If .FilterMode <> True Then
>> > .Rows("1:1").AutoFilter
>> > Else
>> > End If
>> > End With
>> >
>> > With Sheets("Open Transactions by Member ID")
>> > If .FilterMode <> True Then
>> > .Rows("1:1").AutoFilter
>> > Else
>> > End If
>> > End With
>> >
>> > Application.ScreenUpdating = True
>> >
>> > --
>> > Robert

>>
>>
>>



 
Reply With Quote
 
Chip Pearson
Guest
Posts: n/a
 
      21st Jun 2007
You might find my Alerter DLL useful. It allows you to display a message
notification window modelessly. It is much more visible to the user than the
status bar and is not modal like MsgBox is.

http://www.cpearson.com/excel/alert.htm


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)



"robs3131" <(E-Mail Removed)> wrote in message
news:E31FD45D-3FC3-4F8A-9460-(E-Mail Removed)...
> Hi,
>
> I did some searching through prior posts at this site and also looked
> through Help in VBA within Excel but wasn't able to find what I need -
> which
> is I'm looking to have a message window popup when a button is clicked on
> that is then brought down by the code just after the code execution
> completes. Below is what I was hoping to build on -- thanks in advance
> for
> any help you can provide!
>
> Private Sub CommandButton2_Click()
>
> Application.ScreenUpdating = False
>
> MsgBox "Please wait while code executes. This message will " & vbNewLine
> & _
> "automatically close when execution has completed."
>
> Rows("1:1").RowHeight = 60
>
> With Sheets("Transaction Summary")
> If .FilterMode = True Then
> .ShowAllData
> Else
> End If
> End With
>
> With Sheets("Open Transactions by Member ID")
> If .FilterMode = True Then
> .ShowAllData
> Else
> End If
> End With
>
> With Sheets("Member ID Report Master")
> If Len(.Range("D2")) <> 0 Then
> Module1.closedtrans1
> Module2.clearmemidtrans
> Else
> MsgBox "Sales (Member ID Report) transaction data has not yet been
> submitted -" & vbNewLine & _
> "Sales data must be first submitted prior to requesting to see
> open"
> & vbNewLine & _
> "transactions."
> End If
> End With
>
> With Sheets("Transaction Summary")
> If .FilterMode <> True Then
> .Rows("1:1").AutoFilter
> Else
> End If
> End With
>
> With Sheets("Open Transactions by Member ID")
> If .FilterMode <> True Then
> .Rows("1:1").AutoFilter
> Else
> End If
> End With
>
> Application.ScreenUpdating = True
>
> --
> Robert


 
Reply With Quote
 
=?Utf-8?B?cm9iczMxMzE=?=
Guest
Posts: n/a
 
      22nd Jun 2007
Thanks Gary and Chip!

Chip - I went with Gary's solution as it does not require that I download
software into Excel. I assume that any other user of the spreadsheet would
need to also download the software you suggested, is that right?

Thanks!

Robert

--
Robert


"Chip Pearson" wrote:

> You might find my Alerter DLL useful. It allows you to display a message
> notification window modelessly. It is much more visible to the user than the
> status bar and is not modal like MsgBox is.
>
> http://www.cpearson.com/excel/alert.htm
>
>
> --
> Cordially,
> Chip Pearson
> Microsoft MVP - Excel
> Pearson Software Consulting
> www.cpearson.com
> (email on the web site)
>
>
>
> "robs3131" <(E-Mail Removed)> wrote in message
> news:E31FD45D-3FC3-4F8A-9460-(E-Mail Removed)...
> > Hi,
> >
> > I did some searching through prior posts at this site and also looked
> > through Help in VBA within Excel but wasn't able to find what I need -
> > which
> > is I'm looking to have a message window popup when a button is clicked on
> > that is then brought down by the code just after the code execution
> > completes. Below is what I was hoping to build on -- thanks in advance
> > for
> > any help you can provide!
> >
> > Private Sub CommandButton2_Click()
> >
> > Application.ScreenUpdating = False
> >
> > MsgBox "Please wait while code executes. This message will " & vbNewLine
> > & _
> > "automatically close when execution has completed."
> >
> > Rows("1:1").RowHeight = 60
> >
> > With Sheets("Transaction Summary")
> > If .FilterMode = True Then
> > .ShowAllData
> > Else
> > End If
> > End With
> >
> > With Sheets("Open Transactions by Member ID")
> > If .FilterMode = True Then
> > .ShowAllData
> > Else
> > End If
> > End With
> >
> > With Sheets("Member ID Report Master")
> > If Len(.Range("D2")) <> 0 Then
> > Module1.closedtrans1
> > Module2.clearmemidtrans
> > Else
> > MsgBox "Sales (Member ID Report) transaction data has not yet been
> > submitted -" & vbNewLine & _
> > "Sales data must be first submitted prior to requesting to see
> > open"
> > & vbNewLine & _
> > "transactions."
> > End If
> > End With
> >
> > With Sheets("Transaction Summary")
> > If .FilterMode <> True Then
> > .Rows("1:1").AutoFilter
> > Else
> > End If
> > End With
> >
> > With Sheets("Open Transactions by Member ID")
> > If .FilterMode <> True Then
> > .Rows("1:1").AutoFilter
> > Else
> > End If
> > End With
> >
> > Application.ScreenUpdating = True
> >
> > --
> > Robert

>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code Execution Message canderson Microsoft Excel Misc 1 9th Oct 2009 04:28 PM
Stop window saying code execution interrupted at startup? Jerry07 Microsoft Excel Misc 1 15th Aug 2009 05:16 PM
disable message box during VBA code execution juergenkemeter Microsoft Excel Programming 2 12th Jan 2006 01:16 AM
Code Execution has been interrupted message =?Utf-8?B?UmljaCBpbiBZb3JrdG93bg==?= Microsoft Excel Programming 1 20th Dec 2004 05:41 PM
code runs well on 3rd execution after getting Error: 3021 on 1st 2 execution =?Utf-8?B?eWFubg==?= Microsoft Access VBA Modules 0 23rd Mar 2004 10:01 AM


Features
 

Advertising
 

Newsgroups
 


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