Hey everyone,
I am wanting to make a VB macro in excel that will open an IE page and navigate through it and then export data. Is this possible or does it escape the scope of excel macros? It would be doing the same thing each time the report ran.
Hey everyone,
I am wanting to make a VB macro in excel that will open an IE page and navigate through it and then export data. Is this possible or does it escape the scope of excel macros? It would be doing the same thing each time the report ran.
Last edited by ChrisKader; 11-09-2010 at 06:42 PM.
Hello ChrisKader,
I have recently posded several different macros to extract data from web pages using IE and VBA. So to answer you question, yes it can be done.
Last edited by Leith Ross; 11-05-2010 at 05:23 PM. Reason: Retracted statement about searching forum - totally useless
Sincerely,
Leith Ross
Remember To Do the Following....
1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.2. Thank those who have helped you by clicking the Starbelow the post.
3. Please mark your post [SOLVED] if it has been answered satisfactorily.
Old Scottish Proverb...
Luathaid gu deanamh maille! (Rushing causes delays!)
I seen a few of your posts but I am not to sure I understand how they work. The webpage does have a login screen with a username/password. And there is also some data that needs to be filled in (Dates, Employees, etc etc) that I would not really know how to implament.
Hello ChrisKader,
I would need to see the site and the pages you are interested in before I can code a macro for you. It would make things easier not having to log on to the site. Can you post the links?
Unfortunately, the site is internal and proprietary (call center). But I do have the login page source, is there something general you can write up and I can fill in the blanks? I can describe it a little more.
The data for the report has a start and stop date, I need to click a button to run it. To select employees I click a button and another window pops up with the list of employees and select mine. Then click a button to confirm.
I really wish I could post code for the site![]()
Hello ChrisKader,
If you can can post a zip file with page source information for each page you are interested in, that would be outstanding. Tell what you want extracted and I'll write the code to do it.
I am not allowed to post links or code to the site. AT&T would not be to happy about that.
Hello Chris,
Sorry to hear that. You are on your own. The HTML Document Object Model (DOM) is very different from VBA. If you don't have an HTML programming background, this will be difficult for you to do, as you will learning as you go. Here is link that will help. Feel free to ask me any questions you have.
Hey Leith,
So, I am starting with the login page. How would I make a java variable that is the username equal a variable in excel? The answer to this will help later on as well.
Hello Chris,
I can not help you with Java, but here is a basic log on script for VBA. This should for you. Just change the user name, password and URL to what you will be using.
![]()
Please Login or Register to view this content.
Last edited by Leith Ross; 11-05-2010 at 09:07 PM.
Hey Leith Ross,
I got your script working with my site. I ran into a small issue, I get a login confirm screen that requires the users to click OK to continue. What would be the command for that? I tried to use the oInput.Click function, but that did not work.
Thanks for your help!
Hello Chris,
Is this a Windows dialog box or something from the web server? If it is a Windows dialog and the default button choice is "Yes" or "OK" then using Application.DisplayAlerts may be the answer. I have added it to the code below.
![]()
Please Login or Register to view this content.
Hey Leith Ross,
It is just another page that the login page sends you to and it has an OK button and then redirects you to the actual page.
Login -> Confim Page -> Actual Page
Hello Chris,
This change assumes there is only one button on the confirmation page to click.
![]()
Please Login or Register to view this content.
Hey Leith Ross,
I tried the above code, and everything stops at the confirmation screen. For some reason, the code is not either seeing that a new page is loaded, or, it does not see the button.
Hello Chris,
Can you send me a copy of the page source for the confirmation screen?
Hello Chris,
After thinking about this a bit, it could be using an Input Type "Image" instead of "Submit". Check the page source for an Input Image type. The Name property may set to be something like "Submit" or "Enter".
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks