Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel - Access Web Page
I regularly access some web pages - I want to do so via VBA.
I must access them via a log-in page - I can then access all other pages on the site. I have opened the initial web page in my browser and logged in. I then open second page from within VBA but instead of going to called page it goes to log-in page. How can I log-in via VBA - keep web session active (if that is correct terminology) and then access other pages? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel - Access Web Page
Hi Judith,
Below is a function I used once to show that VBA could do a HTTP post to a site. You will need to customise it to login to your website though (included a test to show how it is called): Function searchPost(ByVal strNumber As String, ByVal strName As String, _ ByVal strSuburb As String, ByVal strState As String) Dim ie As Object Set ie = CreateObject("InternetExplorer.Application") On Error GoTo errHandler With ie .navigate "http://www.whereis.com/whereis/map.do" Do While .busy: DoEvents: Loop Do While .ReadyState < 4: DoEvents: Loop With .document.Forms(1) .addressStreetNo1.Value = strNumber .addressStreetName1.Value = strName .addressSuburb1.Value = strSuburb .addressState1.Value = strState .submit End With Do While .busy: DoEvents: Loop Do While .ReadyState < 4: DoEvents: Loop .Visible = True End With Exit Function errHandler: ie.Quit: Set ie = Nothing End Function Sub testSearchAUPost() searchPost "101", "Collins Street", "Melbourne", "Victoria" End Sub Note that the HTTP Document form objects are hardcoded, in your case, you would locate the username/password form fields to place into the script. Hope this helps "judith" wrote: I regularly access some web pages - I want to do so via VBA. I must access them via a log-in page - I can then access all other pages on the site. I have opened the initial web page in my browser and logged in. I then open second page from within VBA but instead of going to called page it goes to log-in page. How can I log-in via VBA - keep web session active (if that is correct terminology) and then access other pages? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel - Access Web Page
On Sun, 30 Mar 2008 16:27:01 -0700, George Z
wrote: Hi Judith, Below is a function I used once to show that VBA could do a HTTP post to a site. <snip That's great - just the start I was looking for - many thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Access wab page with excel VBA | Excel Programming | |||
Is there a way to limit access to a page in Excel to one person? | New Users to Excel | |||
create excel spreadsheet on a data access page | Excel Discussion (Misc queries) | |||
Why do Excel and Access freeze on the splash page? | Excel Discussion (Misc queries) | |||
is it possible for an html/asp page to access Excel directly | Excel Programming |