Home > Software engineering >  Vb vba VBS operation ie problem
Vb vba VBS operation ie problem

Time:09-26

With VBS open the specified web page, then fill out the form automatically, this I realized, the question now is how to use a VBS to an already use IE to open the page or IE pop-up window, realize the automatic control
I use IE to open a page, for example, now I want to call VBS script automatically control the form to fill in or click, and so on, how can such a VBS script writing, thank you for your generous help ~!

CodePudding user response:

 'reference ieframe. DLL 
Private Sub Command1_Click ()
Dim w
Dim s As New SHDocVw. ShellWindows
For Each w In s
If InStr (w. ocationURL, "baidu.com") & gt; 0 Then
W.N avigate (" www.google.cn ")
End the If
Next
End Sub


Look at the code, don't know how to call ieframe. Vb DLL, and then you can control,

CodePudding user response:

Thank you for your help, VBS control pop-up window form, what kind of

CodePudding user response:

VBS can be done, a simple demo again the following
Specific code needs to be modified according to the requirements of your
Ie. Document. Formlogin. Username. Value="https://bbs.csdn.net/topics/admin"
Ie. Document. Formlogin. Password. Value="https://bbs.csdn.net/topics/admin"
Ie. Document. Formlogin. Submit
These three lines is to fill out the form and click on the button, I this is to simulate login router
 
Dim ie set ie=createobject (" internetexplorer. Application ")
Ie. Visible=true on ie. Navigate "http://192.168.1.1"
While Internet explorer. Busy or ie. Readystate<> 4
Wend
Ie. Document. Formlogin. Username. Value="https://bbs.csdn.net/topics/admin"
Ie. Document. Formlogin. Password. Value="https://bbs.csdn.net/topics/admin"
Ie. Document. Formlogin. Submit
  • Related