Solved

WebBrowser progress and progress bar

Posted on 1999-01-09
6
311 Views
Last Modified: 2010-05-03
vb6, ie4, win95

i' m trying to have the progress bar display how much of a webpage has been downloaded.  i read somewhere that i should multiply the "progress" by 100 and divide that by the "progressmax" UNLESS "progress = -1".  so i came up with the following code:

ProgressBar1.Value = (Progress * 100) \ ProgressMax

but i can't quite figure out how to type up the "unless progress = -1" part.  an explaination and code would be great.  thanx
0
Comment
Question by:llcoolmel
6 Comments
 
LVL 1

Expert Comment

by:cyber_bandit
ID: 1455153
if progressbar1.value <> -1 then
     blah blah blah
 else
     blah blah blah
 end if
0
 

Author Comment

by:llcoolmel
ID: 1455154
but now i always get a "divide by zero" error or something similar.  if you can provide me with a full code that will show the progress of my webpage loading that works, i will award the points.  i have upped the points to 100.
0
 
LVL 1

Expert Comment

by:cyber_bandit
ID: 1455155
I am not familiar with your web page loading code... I think the divide by zero error does not have anything to do with you progress bar though.  That error is due to some math function you have prior to the progress bar value setting.  I would imagine you are trying to figure out the Progressbar.value in the step before you update the actualy visual value.  take a look at that code and see if you can figure out the numbers in there. Appears something is not initialized.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Accepted Solution

by:
GETTYD earned 200 total points
ID: 1455156
dim u as integer
dim a as long

a = Progress * 100
u = u

ProgressBar1.Value = (Progress * 100) \ ProgressMax

1. place cursor on "u = u" line
2. press F9
3. run the program
4. it should break on the "u = u" line
5. place the cursor on "a"
    (this will give you the value of "Progress * 100"
6. place the cursor on "ProgressMax"
    (this will give you the value of "ProgressMax"
7. you should now be able to figure out what's going on with your code

0
 

Author Comment

by:llcoolmel
ID: 1455157
i appreciate the input, however, your step number 7...i'm still a novice programmer and i do not know how to use the input you gave me to solve my problem.  could you please give me a very specific code that won't give me that darn "divide by zero" or similar errors??

i will up the points to 200
0
 
LVL 14

Expert Comment

by:waty
ID: 2210553
Bought This Question.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
vba is buggy because of corrupted user profile. Any fast way to fix it? 28 129
Vb.net 2008 2 56
VB6 Compile Compatibility Issue 4 90
Access query that references subform 5 43
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now