473,383 Members | 1,868 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Web automation in VB 2005

chantymalo
I'm trying to create a VB application that will open a web browser on a specific page (http://www.itam.mx/es/servicios/servicios.php), insert the login (Clave Única) and (NIP) password and click the Login button (ENTRAR) on the page, all this automatically.

I have tried this:

Dim explorador
explorador = CreateObject("InternetExplorer.Application")

explorador.Navigate("http://www.itam.mx/es/servicios/servicios.php")
explorador.Visible = True

explorador.Document.All.Item("txt_clave").Value = ""
explorador.Document.All.Item("txt_nip").Value = ""
explorador.Document.All.Item("entrar").Click()


but it doesn't works at all. And I don´t have any other ideas on how to do this.

...thanks.
Feb 27 '07 #1
5 1358
Killer42
8,435 Expert 8TB
Did you do it all straight through from start to finish as shown here? Because I believe you need to wait until the Navigation and Document are completed before going ahead.
Feb 28 '07 #2
I see I would need to wait for the document to be loaded? something like this:

Dim explorador
explorador = CreateObject("InternetExplorer.Application")

explorador.Navigate("http://www.itam.mx/es/servicios/servicios.php")
explorador.Visible = True

explorador.wait(8000) '?????

explorador.Document.All.Item("txt_clave").Value = ""
explorador.Document.All.Item("txt_nip").Value = ""
explorador.Document.All.Item("entrar").Click()
Feb 28 '07 #3
Killer42
8,435 Expert 8TB
I think you'll do better if you exploit the event-driven nature of VB. Rather than trying to go through this is a set sequence as you have shown, you probably should exit this piece of code after executing the Navigate method. Then do the rest in the event procedure triggered when the document is complete.

I played with this a while back, and I think the event is actually called DocumentComplete, but I could be wrong.

If you do want to do it the way you've shown here, I would not recommend waiting for a set length of time, as the time to load a document can vary enormously. You would do better to wait until the status of the control/document changes, or watch for a global flag which is set in the DocumentComplete event procedure, or something along those lines. In other words, wait until the document is actually completed (or failed?) not for a specific time.
Feb 28 '07 #4
thanks... I'm going to try something different.
Feb 28 '07 #5
Killer42
8,435 Expert 8TB
thanks... I'm going to try something different.
Ok. Good luck!
Feb 28 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: jabailo | last post by:
I came across this article while researching a VB6 430 error: INFO: Considerations for Server-Side Automation of Office http://support.microsoft.com/default.aspx?scid=kb;EN-US;q257757 ...
7
by: taylor.bryant | last post by:
I am running: Win XP SP2 Excel 2002, Access 2002 (Office XP SP3) Using Visual Basic (not VB.NET) At one point (prior to XP SP2?!? - I can't pin it down), this did not happen and I was easily...
21
by: Neil | last post by:
Is there a way to trap an error generated in another app that is controlled via automation? I have an Access 2000 app that opens Word 2000 and proceeds to open a series of documents and, in each...
3
by: Stephen Brooker | last post by:
Hi all, Just playing around a MS how-to sample to work with an Excel file from within C#. Everything is fine and I understand it OK, however when Excel and the application are closed, there is...
7
by: Franck | last post by:
Hi, I'm using an xls file through my web service to print out a pdf file from which I returned path. In this way, got a macro in my XLS file which do the print out. Testing it from the xls file...
1
by: Franck | last post by:
hello, I've found this tutorial for word automation in asp http://www.codeproject.com/aspnet/wordapplication.asp TO work I need to include the "Microsoft Word 10.0 Object Library dll" But...
6
by: a.theil | last post by:
Please help! I need a simple excel automation, just 2 write some files into excel. I do: Dim oXL As Excel.Application Dim oWB As Excel.Workbook Dim oSheet As Excel.Worksheet Dim oRng As...
5
by: Jason James | last post by:
I all, I have a VB.Net app that words just fine when automating MS Word 2003, when Word is part of MS Office Professional edition (even with SP1 installed). However, if I install the app onto...
9
by: Chubbly Geezer | last post by:
Hope you can help. I have created a mail merge word doc which seems to work fine. When I close and reload it asks if I wish to pull in the data. Great. However, I want to print the results of...
12
by: Tomas | last post by:
Hi, I have worked with VB.NET for half a year (semi-newbie). Currently I am looking around for some books for those that crossed the starting hurdle. There are too many books out there-make...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.