Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access wab page with excel VBA Madiya Excel Programming 4 December 11th 07 01:14 PM
Is there a way to limit access to a page in Excel to one person? tarina94 New Users to Excel 2 December 11th 06 10:54 PM
create excel spreadsheet on a data access page Pitu Excel Discussion (Misc queries) 0 October 3rd 05 08:11 PM
Why do Excel and Access freeze on the splash page? Chris Excel Discussion (Misc queries) 0 May 12th 05 04:00 PM
is it possible for an html/asp page to access Excel directly colinlyse Excel Programming 0 November 7th 03 02:40 PM


All times are GMT +1. The time now is 06:53 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"