Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Has anyone created a "Progress Meter" in EB

Status
Not open for further replies.

tescojez

Programmer
May 28, 2007
10
GB
Hi Guys,

I have a couple of Macros that do some heavy duty number crunching in the background and also create large text files on different servers over the network. While these processes are happening there is no indication that the macro is doing anything.

Has anyone created anything, in EB, that shows the user "Running..." or better still how far thru the process is eg "Running...45%" etc. I don't want the user to have to respond to a prompt in MsgBox or similar; And I don't want it to impact the performance too much.

Any pointers would be greatly received (and I will respond this time... Sorry SKIE!)

Jez
 
Here's one I borrowed from Mark in the VBS Forum. The nessecary changes have been made to run via EB.

Code:
' AUTHOR: Mark D. MacLachlan , The Spider's Parlor
' URL: [URL unfurl="true"]http://www.thespidersparlor.com[/URL]
' DATE  : 8/11/2004


Function DisplayProgress(stage)
    dim x as Object
    set x = createobject("internetexplorer.application")
    'in code, the colon acts as a line feed
    x.navigate2 "about:blank" : x.width = 350 : x.height = 80 : x.toolbar = false : x.menubar = false : x.statusbar = false : x.visible = True

    x.document.write "<font color=blue>"
    For n = 1 to 100
        x.document.write "|"
        DoEvents
        x.document.title = "Stage " & stage & " " & n & " %"
    Next
    stage = stage + 1
    'close the window
    x.quit
    set x = nothing
    DisplayProgress = stage
End Function


Sub Main

TestCondition = ""
stage = 1
Do 
   If stage > 0 Then
           stage = DisplayProgress(stage)
   End If
Loop While TestCondition = ""

End Sub

[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.
 
Thanks Mr Milson for that,

I am not at work (with no access to EB), so I can't check the variable "TestCondition" - Is this a reserved variable? (Excuse my ignorance!) or, where does it get set to Non-""?

Will check it out in the next couple of days at work.

Jez

 
As written the example will run indefinately. You would need to set up the conditions/values in your script to populate and terminate the progress bar.

[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
Again Thanx for your response MrMilson.

Tried your code today and it worked great.... Then was able to develop it in my "simplistic way" and it worked even greater! Thanx for the pointers.

BTW: Where can I find a list of all the variables attached to the ("internetexplorer.application") object? Also, I have found a raft of tips, on this site, on things like placing values straight into Excel spreadsheets, etc, etc - This is the first time that my system has actually allowed me to open another application, in this example IE. Is this because my PC at work is "locked down" or if trying to access Excel I am using the wrong syntax?

Jez
 
Post the code your attempting to open Excel with.

[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
Thanks was looking for something like for a while. Everything is working great but how:

Can I show this progress bar to the user on the mainframe. Currently the progress run in the minimized window on the window toolbar.

How can it be display to the user something like
x.show =true or x.maximized=true

Otherwise this progress bar does miracle.

Thanks
 
x.visible = True


[small]Sometimes you gotta leave your zone of safety. You have to manufacture Inspirado. You gotta get out of the apartment. You've got to run with the wolves. You've got to dive into the ocean and fight with the sharks. Or just treat yourself to a delicious hot fudge sundae........ with nuts. - Jack Black[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top