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
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
what about something like:
http://www.cpearson.com/excel/Progress.htm
the LED class j back link on page is pretty funky in a geeky type of way.
and as a bonus you wont need to register any dlls
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" <Stefi@discussions.microsoft.com> wrote in message
news:510F726B-7027-45C0-B641-0EC01A83F6AF@microsoft.com...
> 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
>
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" <Stefi@discussions.microsoft.com> wrote in message
news:510F726B-7027-45C0-B641-0EC01A83F6AF@microsoft.com...
> 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
>
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" <Stefi@discussions.microsoft.com> wrote in message
> news:510F726B-7027-45C0-B641-0EC01A83F6AF@microsoft.com...
> > 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
> >
>
>
>
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
>
>
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" <Stefi@discussions.microsoft.com> wrote in message
news:4439FE79-CA73-4B10-B92E-85A8CA002A0C@microsoft.com...
> 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
> >
> >
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" <Stefi@discussions.microsoft.com> wrote in message
> news:4439FE79-CA73-4B10-B92E-85A8CA002A0C@microsoft.com...
> > 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,
'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.
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?
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" <Stefi@discussions.microsoft.com> wrote in message
news:BBF17214-9ED3-4A5D-AD45-E64EAA559B20@microsoft.com...
> 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" <Stefi@discussions.microsoft.com> wrote in message
> > news:4439FE79-CA73-4B10-B92E-85A8CA002A0C@microsoft.com...
> > > 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
> > > >
> > > >
> >
> >
> >
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
(MattShoreson.1s0j2o_1121098531.9781@excelforum-nospam.com) 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
>
>
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
(MattShoreson.1s0j2o_1121098531.9781@excelforum-nospam.com) 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 I have updated mail address in my profile - try again.
Matt,
Unfortunately e-mails sent to the address in your profile still come back
with error message:
550 5.1.2 <MattShoreson.1s4b76_1121274472.4836@excelforum-nospam.com>...
Host unknown (Name server: excelforum-nospam.com: host not found)
I hope you got the message sent to mail@homes-page.co.uk
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
>
>
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" <Stefi@discussions.microsoft.com> wrote in message
> news:BBF17214-9ED3-4A5D-AD45-E64EAA559B20@microsoft.com...
> > 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" <Stefi@discussions.microsoft.com> wrote in message
> > > news:4439FE79-CA73-4B10-B92E-85A8CA002A0C@microsoft.com...
> > > > 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
> > > > >
> > > > >
> > >
> > >
> > >
>
>
>
Check your email I have replied to your mail account.
LED progress bar struggles when being initiated from a userform. It's fine when launuched from the worksheet.
Last edited by MattShoreson; 07-14-2005 at 07:12 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks