ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   message without stopping execution? (https://www.excelbanter.com/excel-programming/332079-message-without-stopping-execution.html)

Stefi

message without stopping execution?
 
Hi All,
Is there any method to display a message during a lengthy process to inform
the user on progress of the process without stopping execution as MsgBox
always does?
Stefi


Bob Phillips[_7_]

message without stopping execution?
 
Is the problem that you don't want the code interrupted, or that you want
the MsgBox timed, and not depend upon a user responding. If the latter, use

Dim cTime As Long
Dim WSH As Object


Set WSH = CreateObject("WScript.Shell")
cTime = 10 ' 10 secs
Select Case WSH.Popup("Open an Excel file?!", cTime, "Question", _
vbOKCancel)
Case vbOK
MsgBox "You clicked OK"
Case vbCancel
MsgBox "You clicked Cancel"
Case -1
MsgBox "Timed out"
Case Else
End Select


--
HTH

Bob Phillips

"Stefi" wrote in message
...
Hi All,
Is there any method to display a message during a lengthy process to

inform
the user on progress of the process without stopping execution as MsgBox
always does?
Stefi




Chris Ferguson

message without stopping execution?
 
Would it be feasable to show the progess on a new sheet and periodically
switch back on the screen updating so that the user can see how the process
is updating.
Or can you use the Application.statusbar = "Message" to keep the user
informed?

Chris


"Stefi" wrote in message
...
Hi All,
Is there any method to display a message during a lengthy process to
inform
the user on progress of the process without stopping execution as MsgBox
always does?
Stefi




MattShoreson[_29_]

message without stopping execution?
 

what about something like:

http://www.cpearson.com/excel/Progress.ht

--
MattShoreso
-----------------------------------------------------------------------
MattShoreson's Profile: http://www.excelforum.com/member.php...nfo&userid=347
View this thread: http://www.excelforum.com/showthread.php?threadid=38001


MattShoreson[_31_]

message without stopping execution?
 

the LED class j back link on page is pretty funky in a geeky type o
way

--
MattShoreso
-----------------------------------------------------------------------
MattShoreson's Profile: http://www.excelforum.com/member.php...nfo&userid=347
View this thread: http://www.excelforum.com/showthread.php?threadid=38001


MattShoreson[_30_]

message without stopping execution?
 

and as a bonus you wont need to register any dll

--
MattShoreso
-----------------------------------------------------------------------
MattShoreson's Profile: http://www.excelforum.com/member.php...nfo&userid=347
View this thread: http://www.excelforum.com/showthread.php?threadid=38001


Stefi

message without stopping execution?
 
The latter was the case, and you gave me a good solution, thank you!
Nevertheless, Chris's suggestion Application.statusbar = "Message" is
simpler and sufficient in my case.
Regards,
Stefi


€˛Bob Phillips€¯ ezt Ć*rta:

Is the problem that you don't want the code interrupted, or that you want
the MsgBox timed, and not depend upon a user responding. If the latter, use

Dim cTime As Long
Dim WSH As Object


Set WSH = CreateObject("WScript.Shell")
cTime = 10 ' 10 secs
Select Case WSH.Popup("Open an Excel file?!", cTime, "Question", _
vbOKCancel)
Case vbOK
MsgBox "You clicked OK"
Case vbCancel
MsgBox "You clicked Cancel"
Case -1
MsgBox "Timed out"
Case Else
End Select


--
HTH

Bob Phillips

"Stefi" wrote in message
...
Hi All,
Is there any method to display a message during a lengthy process to

inform
the user on progress of the process without stopping execution as MsgBox
always does?
Stefi





Stefi

message without stopping execution?
 
Dear Matt,

I just now reviewed the topics I was interested in. I hope you come back to
this topic, although quite a long time elapsed since your reply to my
question above (sending e-mail directly to your address failed).
I have found earlier http://www.cpearson.com/excel/Progress.htm page, I made
a test, and I found it not too convenient to use, but I missed the reference
to the "LED" type progress bar you attracted my attention to.
I just now downloaded and tested it (very nice), but I have to ask your help
to clearly understand your messages. You must forgive me for disturbing you
with such things, but my mother tongue is not English (in fact it's
Hungarian), and I don't know the meaning of words "funky" and "geeky", would
you give me some explanation or synonims (I didn't found these words even in
the largest English-Hungarian dictionary). Also I couldn't find out the
meaning of "class j" back link.

Regards,
Stefi

"MattShoreson€¯ ezt Ć*rta:


and as a bonus you wont need to register any dlls


--
MattShoreson
------------------------------------------------------------------------
MattShoreson's Profile: http://www.excelforum.com/member.php...fo&userid=3472
View this thread: http://www.excelforum.com/showthread...hreadid=380019



Tom Ogilvy

message without stopping execution?
 
geeky - generally refers to someone who is not very athletic and is very
good with technical things such as computers. Bill Gates might be
considered geeky

funky - refers to something or someone that is popular because that
something or someone exhibits behavior or appearance that enjoys popular
acclaim. This is often associated with music and musicians. The term is
somewhat dated.

In the context:
"the LED class j back link on page is pretty funky in a geeky type of way."

Matt means the use of the LED is pretty impressive if you are impressed by
techical approaches/implementation.

--
Regards,
Tom Ogilvy

"Stefi" wrote in message
...
Dear Matt,

I just now reviewed the topics I was interested in. I hope you come back

to
this topic, although quite a long time elapsed since your reply to my
question above (sending e-mail directly to your address failed).
I have found earlier http://www.cpearson.com/excel/Progress.htm page, I

made
a test, and I found it not too convenient to use, but I missed the

reference
to the "LED" type progress bar you attracted my attention to.
I just now downloaded and tested it (very nice), but I have to ask your

help
to clearly understand your messages. You must forgive me for disturbing

you
with such things, but my mother tongue is not English (in fact it's
Hungarian), and I don't know the meaning of words "funky" and "geeky",

would
you give me some explanation or synonims (I didn't found these words even

in
the largest English-Hungarian dictionary). Also I couldn't find out the
meaning of "class j" back link.

Regards,
Stefi

"MattShoreson" ezt ķrta:


and as a bonus you wont need to register any dlls


--
MattShoreson
------------------------------------------------------------------------
MattShoreson's Profile:

http://www.excelforum.com/member.php...fo&userid=3472
View this thread:

http://www.excelforum.com/showthread...hreadid=380019





Stefi

message without stopping execution?
 
Thanks, Tom, I never thought that I can get such precise answers to
linguistic questions via an Excel forum!
However! I tested the LED type Progressbar demo, and it worked well, but
when I tried to transplant it into my own code, it did nothing. I got no
error messages, the code run smoothly, but nothing appeared in the status
bar. I copied the class module into my workbook, applied the
Set sb = New clsProgressBar ' create a new progress bar
sb.Show "Please wait", vbNullString, 0 ' display the progress bar
....
for
sb.PercentComplete = i ' update the progress bar
next
....
Set sb = Nothing ' remove the progress bar

lines in my code, what can be wrong?

Do you get a warning if a new message comes to an old topic?

Regards,
Stefi

€˛Tom Ogilvy€¯ ezt Ć*rta:

geeky - generally refers to someone who is not very athletic and is very
good with technical things such as computers. Bill Gates might be
considered geeky

funky - refers to something or someone that is popular because that
something or someone exhibits behavior or appearance that enjoys popular
acclaim. This is often associated with music and musicians. The term is
somewhat dated.

In the context:
"the LED class j back link on page is pretty funky in a geeky type of way."

Matt means the use of the LED is pretty impressive if you are impressed by
techical approaches/implementation.

--
Regards,
Tom Ogilvy

"Stefi" wrote in message
...
Dear Matt,

I just now reviewed the topics I was interested in. I hope you come back

to
this topic, although quite a long time elapsed since your reply to my
question above (sending e-mail directly to your address failed).
I have found earlier http://www.cpearson.com/excel/Progress.htm page, I

made
a test, and I found it not too convenient to use, but I missed the

reference
to the "LED" type progress bar you attracted my attention to.
I just now downloaded and tested it (very nice), but I have to ask your

help
to clearly understand your messages. You must forgive me for disturbing

you
with such things, but my mother tongue is not English (in fact it's
Hungarian), and I don't know the meaning of words "funky" and "geeky",

would
you give me some explanation or synonims (I didn't found these words even

in
the largest English-Hungarian dictionary). Also I couldn't find out the
meaning of "class j" back link.

Regards,
Stefi

"MattShoreson" ezt Ć*rta:


and as a bonus you wont need to register any dlls


--
MattShoreson
------------------------------------------------------------------------
MattShoreson's Profile:

http://www.excelforum.com/member.php...fo&userid=3472
View this thread:

http://www.excelforum.com/showthread...hreadid=380019






MattShoreson[_40_]

message without stopping execution?
 

Tom,

'Funky' was used in more of a retro sense (I dont feel it is dated.)
I could of used 'book' - but much preferred funky in this instance.

NB: it also means smelly.

Cheers,
Matt

--
MattShoreso
-----------------------------------------------------------------------
MattShoreson's Profile: http://www.excelforum.com/member.php...nfo&userid=347
View this thread: http://www.excelforum.com/showthread.php?threadid=38001


MattShoreson[_39_]

message without stopping execution?
 

Stefi,

I have transplanted the progress bar cls, the simple progress bar an
the wait seconds procedure to a new workbook.

It works fine. I would suggest that maybe something is conflictin
with the display status bar.

Is it possible to post some of the code

--
MattShoreso
-----------------------------------------------------------------------
MattShoreson's Profile: http://www.excelforum.com/member.php...nfo&userid=347
View this thread: http://www.excelforum.com/showthread.php?threadid=38001


Tom Ogilvy

message without stopping execution?
 
Here is a simpler implementation posted by Michael Pierron

Posted by Michael Pierron (May 28, 2004)
Microsoft.public.excel.programming

Private Declare Function FindWindow& Lib "user32" Alias _
"FindWindowA" (ByVal lpClassName$, ByVal lpWindowName$)
Private Declare Function CreateWindowEX& Lib "user32" Alias _
"CreateWindowExA" (ByVal dwExStyle&, ByVal lpClassName$ _
, ByVal lpWindowName$, ByVal dwStyle&, ByVal x&, ByVal y& _
, ByVal nWidth&, ByVal nHeight&, ByVal hWndParent& _
, ByVal hMenu&, ByVal hInstance&, lpParam As Any)
Private Declare Function DestroyWindow& Lib "user32" (ByVal hWnd&)
Private Declare Function SendMessage& Lib "user32" Alias _
"SendMessageA" (ByVal hWnd&, ByVal wMsg&, ByVal wParam&, lParam As Any)
Private Declare Function GetClientRect& Lib "user32" _
(ByVal hWnd&, lpRect As RECT)
Private Declare Function FindWindowEx& Lib "user32" Alias _
"FindWindowExA" (ByVal hWnd1&, ByVal hWnd2&, ByVal lpsz1$, ByVal lpsz2$)

Private Type RECT
cl As Long
ct As Long
cr As Long
cb As Long
End Type

Sub PBarDraw()
Dim BarState As Boolean
Dim hWnd&, pbhWnd&, y&, h&, i&, R As RECT
hWnd = FindWindow(vbNullString, Application.Caption)
hWnd = FindWindowEx(hWnd, ByVal 0&, "EXCEL4", vbNullString)
GetClientRect hWnd, R
h = (R.cb - R.ct) - 6: y = R.ct + 3
pbhWnd = CreateWindowEX(0, "msctls_progress32", "" _
, &H50000000, 35, y, 185, h, hWnd, 0&, 0&, 0&)
SendMessage pbhWnd, &H409, 0, ByVal RGB(0, 0, 125)
BarState = Application.DisplayStatusBar
Application.DisplayStatusBar = True
For i = 1 To 50000
DoEvents
Application.StatusBar = Format(i / 50000, "0%")
SendMessage pbhWnd, &H402, Val(Application.StatusBar), 0
Next i
DestroyWindow pbhWnd
Application.StatusBar = False
Application.DisplayStatusBar = BarState
End Sub


--
Regards,
Tom Ogilvy

"Stefi" wrote in message
...
Thanks, Tom, I never thought that I can get such precise answers to
linguistic questions via an Excel forum!
However! I tested the LED type Progressbar demo, and it worked well, but
when I tried to transplant it into my own code, it did nothing. I got no
error messages, the code run smoothly, but nothing appeared in the status
bar. I copied the class module into my workbook, applied the
Set sb = New clsProgressBar ' create a new progress bar
sb.Show "Please wait", vbNullString, 0 ' display the progress bar
...
for
sb.PercentComplete = i ' update the progress bar
next
...
Set sb = Nothing ' remove the progress bar

lines in my code, what can be wrong?

Do you get a warning if a new message comes to an old topic?

Regards,
Stefi

"Tom Ogilvy" ezt ķrta:

geeky - generally refers to someone who is not very athletic and is very
good with technical things such as computers. Bill Gates might be
considered geeky

funky - refers to something or someone that is popular because that
something or someone exhibits behavior or appearance that enjoys popular
acclaim. This is often associated with music and musicians. The term

is
somewhat dated.

In the context:
"the LED class j back link on page is pretty funky in a geeky type of

way."

Matt means the use of the LED is pretty impressive if you are impressed

by
techical approaches/implementation.

--
Regards,
Tom Ogilvy

"Stefi" wrote in message
...
Dear Matt,

I just now reviewed the topics I was interested in. I hope you come

back
to
this topic, although quite a long time elapsed since your reply to my
question above (sending e-mail directly to your address failed).
I have found earlier http://www.cpearson.com/excel/Progress.htm page,

I
made
a test, and I found it not too convenient to use, but I missed the

reference
to the "LED" type progress bar you attracted my attention to.
I just now downloaded and tested it (very nice), but I have to ask

your
help
to clearly understand your messages. You must forgive me for

disturbing
you
with such things, but my mother tongue is not English (in fact it's
Hungarian), and I don't know the meaning of words "funky" and "geeky",

would
you give me some explanation or synonims (I didn't found these words

even
in
the largest English-Hungarian dictionary). Also I couldn't find out

the
meaning of "class j" back link.

Regards,
Stefi

"MattShoreson" ezt ķrta:


and as a bonus you wont need to register any dlls


--
MattShoreson

------------------------------------------------------------------------
MattShoreson's Profile:

http://www.excelforum.com/member.php...fo&userid=3472
View this thread:

http://www.excelforum.com/showthread...hreadid=380019








Stefi

message without stopping execution?
 
Dear Matt,
I also tried the method in a new workbook and it worked. Obviously there is
something in my code conflicting with the display of the status bar, but I
couldn't find out what's that. Of course I would post the code, but its too
large to paste it here, in fact it consists of a workbook containing the
macros and some other workbooks to be processed that are required to run the
macros. Tell me, please, where and what to send you! I tried to send you an
e-mail to the address found in your profile
) but it was
rejected.

Regards,
Stefi


€˛MattShoreson€¯ ezt Ć*rta:


Stefi,

I have transplanted the progress bar cls, the simple progress bar and
the wait seconds procedure to a new workbook.

It works fine. I would suggest that maybe something is conflicting
with the display status bar.

Is it possible to post some of the code?


--
MattShoreson
------------------------------------------------------------------------
MattShoreson's Profile: http://www.excelforum.com/member.php...fo&userid=3472
View this thread: http://www.excelforum.com/showthread...hreadid=380019



Stefi

message without stopping execution?
 
Hi Matt,
I also tried the method in a new workbook and it worked. My code is too long
to copy it here, please tell me where to send it! I tried to send you an
e-mail to the address found in your profile
) but it was
rejected.

Regards,
Stefi


€˛MattShoreson€¯ ezt Ć*rta:


Stefi,

I have transplanted the progress bar cls, the simple progress bar and
the wait seconds procedure to a new workbook.

It works fine. I would suggest that maybe something is conflicting
with the display status bar.

Is it possible to post some of the code?


--
MattShoreson
------------------------------------------------------------------------
MattShoreson's Profile: http://www.excelforum.com/member.php...fo&userid=3472
View this thread: http://www.excelforum.com/showthread...hreadid=380019



MattShoreson[_41_]

message without stopping execution?
 

try


--
MattShoreson
------------------------------------------------------------------------
MattShoreson's Profile:
http://www.excelforum.com/member.php...fo&userid=3472
View this thread: http://www.excelforum.com/showthread...hreadid=380019


MattShoreson[_42_]

message without stopping execution?
 

Stefi I have updated mail address in my profile - try again.


--
MattShoreson
------------------------------------------------------------------------
MattShoreson's Profile: http://www.excelforum.com/member.php...fo&userid=3472
View this thread: http://www.excelforum.com/showthread...hreadid=380019


Stefi

message without stopping execution?
 
Matt,
Unfortunately e-mails sent to the address in your profile still come back
with error message:

550 5.1.2 ...
Host unknown (Name server: excelforum-nospam.com: host not found)

I hope you got the message sent to

Regards,
Stefi


€˛MattShoreson€¯ ezt Ć*rta:


Stefi I have updated mail address in my profile - try again.


--
MattShoreson
------------------------------------------------------------------------
MattShoreson's Profile:
http://www.excelforum.com/member.php...fo&userid=3472
View this thread: http://www.excelforum.com/showthread...hreadid=380019



Stefi

message without stopping execution?
 
Hi Tom,
This works in the environment in which CPearsons' solution doesn't, god
knows why.
Thanks,
Stefi


€˛Tom Ogilvy€¯ ezt Ć*rta:

Here is a simpler implementation posted by Michael Pierron

Posted by Michael Pierron (May 28, 2004)
Microsoft.public.excel.programming

Private Declare Function FindWindow& Lib "user32" Alias _
"FindWindowA" (ByVal lpClassName$, ByVal lpWindowName$)
Private Declare Function CreateWindowEX& Lib "user32" Alias _
"CreateWindowExA" (ByVal dwExStyle&, ByVal lpClassName$ _
, ByVal lpWindowName$, ByVal dwStyle&, ByVal x&, ByVal y& _
, ByVal nWidth&, ByVal nHeight&, ByVal hWndParent& _
, ByVal hMenu&, ByVal hInstance&, lpParam As Any)
Private Declare Function DestroyWindow& Lib "user32" (ByVal hWnd&)
Private Declare Function SendMessage& Lib "user32" Alias _
"SendMessageA" (ByVal hWnd&, ByVal wMsg&, ByVal wParam&, lParam As Any)
Private Declare Function GetClientRect& Lib "user32" _
(ByVal hWnd&, lpRect As RECT)
Private Declare Function FindWindowEx& Lib "user32" Alias _
"FindWindowExA" (ByVal hWnd1&, ByVal hWnd2&, ByVal lpsz1$, ByVal lpsz2$)

Private Type RECT
cl As Long
ct As Long
cr As Long
cb As Long
End Type

Sub PBarDraw()
Dim BarState As Boolean
Dim hWnd&, pbhWnd&, y&, h&, i&, R As RECT
hWnd = FindWindow(vbNullString, Application.Caption)
hWnd = FindWindowEx(hWnd, ByVal 0&, "EXCEL4", vbNullString)
GetClientRect hWnd, R
h = (R.cb - R.ct) - 6: y = R.ct + 3
pbhWnd = CreateWindowEX(0, "msctls_progress32", "" _
, &H50000000, 35, y, 185, h, hWnd, 0&, 0&, 0&)
SendMessage pbhWnd, &H409, 0, ByVal RGB(0, 0, 125)
BarState = Application.DisplayStatusBar
Application.DisplayStatusBar = True
For i = 1 To 50000
DoEvents
Application.StatusBar = Format(i / 50000, "0%")
SendMessage pbhWnd, &H402, Val(Application.StatusBar), 0
Next i
DestroyWindow pbhWnd
Application.StatusBar = False
Application.DisplayStatusBar = BarState
End Sub


--
Regards,
Tom Ogilvy

"Stefi" wrote in message
...
Thanks, Tom, I never thought that I can get such precise answers to
linguistic questions via an Excel forum!
However! I tested the LED type Progressbar demo, and it worked well, but
when I tried to transplant it into my own code, it did nothing. I got no
error messages, the code run smoothly, but nothing appeared in the status
bar. I copied the class module into my workbook, applied the
Set sb = New clsProgressBar ' create a new progress bar
sb.Show "Please wait", vbNullString, 0 ' display the progress bar
...
for
sb.PercentComplete = i ' update the progress bar
next
...
Set sb = Nothing ' remove the progress bar

lines in my code, what can be wrong?

Do you get a warning if a new message comes to an old topic?

Regards,
Stefi

"Tom Ogilvy" ezt Ć*rta:

geeky - generally refers to someone who is not very athletic and is very
good with technical things such as computers. Bill Gates might be
considered geeky

funky - refers to something or someone that is popular because that
something or someone exhibits behavior or appearance that enjoys popular
acclaim. This is often associated with music and musicians. The term

is
somewhat dated.

In the context:
"the LED class j back link on page is pretty funky in a geeky type of

way."

Matt means the use of the LED is pretty impressive if you are impressed

by
techical approaches/implementation.

--
Regards,
Tom Ogilvy

"Stefi" wrote in message
...
Dear Matt,

I just now reviewed the topics I was interested in. I hope you come

back
to
this topic, although quite a long time elapsed since your reply to my
question above (sending e-mail directly to your address failed).
I have found earlier http://www.cpearson.com/excel/Progress.htm page,

I
made
a test, and I found it not too convenient to use, but I missed the
reference
to the "LED" type progress bar you attracted my attention to.
I just now downloaded and tested it (very nice), but I have to ask

your
help
to clearly understand your messages. You must forgive me for

disturbing
you
with such things, but my mother tongue is not English (in fact it's
Hungarian), and I don't know the meaning of words "funky" and "geeky",
would
you give me some explanation or synonims (I didn't found these words

even
in
the largest English-Hungarian dictionary). Also I couldn't find out

the
meaning of "class j" back link.

Regards,
Stefi

"MattShoreson" ezt Ć*rta:


and as a bonus you wont need to register any dlls


--
MattShoreson

------------------------------------------------------------------------
MattShoreson's Profile:
http://www.excelforum.com/member.php...fo&userid=3472
View this thread:
http://www.excelforum.com/showthread...hreadid=380019









MattShoreson[_43_]

message without stopping execution?
 

Check your email I have replied to your mail account.

LED progress bar struggles when being initiated from a userform. It'
fine when launuched from the worksheet

--
MattShoreso
-----------------------------------------------------------------------
MattShoreson's Profile: http://www.excelforum.com/member.php...nfo&userid=347
View this thread: http://www.excelforum.com/showthread.php?threadid=38001



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com