Solved

Web Browser Windows

Posted on 2006-07-04
4
174 Views
Last Modified: 2010-04-30
I need an application to test a case study and am in dire need of help, seeing as my knowledge of computer programming is lacking in sustenance. Help would be very much appreciated! I need a program that generates a random string that is 10 letters long and then opens it as a url in a web browser. This process should be repeated at random intervals of time.
Thanks for all your help experts!
0
Comment
Question by:momonja
4 Comments
 
LVL 35

Accepted Solution

by:
Raynard7 earned 165 total points
ID: 17036104
for the random string you would need something like

randomize timer

public function retStr(chrLen as long) as string
dim lngLc as long

retStr = ""

for lngLc = 1 to 10
    retstr = retstr & chr(cint(round(rnd() * 25 + 1)) + 65)
next lnglc

end function

for the random timer interval what I would do is have a timer on your form set to check every 1 second
I would have a global variable which was of a date - initilised to the current time on form load.

then when the timer event is triggered i would check if now() > timeVariable

when you have finished opening the url i would set timeVariable = dateadd("s", round(rnd()*500), now()) which would add a random number of seconds to the current time (between 0 and 500)

Finally for the opening of the url in a browser - you can use the internetExplorer object

like

    Set objIE = New InternetExplorer
    objIE.Visible = True
    objIE.navigate "http://www.yourpage.com"
    While objIE.readyState <> READYSTATE_COMPLETE
        DoEvents
    Wend
    Dim objHTML As HTMLDocument
    Set objHTML = objIE.document
    While objHTML.readyState <> "complete"
        DoEvents
    Wend

there is plenty of stuff if you google the InternetExplorer object
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB 6.0 printer how to align 6 67
Notepad++ how to remove delimiter : from beggning of the line? 3 114
Hide vba in gp 7 106
adding "ungroup sheets" to existing vbs code 5 31
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…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

828 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