Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default This is not strictly excel, but I am running it from an excel macro

Hi

I anyone knows a better NG to get an answer, please let me know.

Anyway... I'm trying to load a password protected web page:

http://extranet.4projects.com/

This is as far as I've got:

Sub Projects_4()
Dim oIE As New SHDocVw.InternetExplorer

Set oIE = New SHDocVw.InternetExplorer
oIE.Navigate "http://extranet.4projects.com/ "
Do Until Not oIE.Busy
DoEvents
Loop
oIE.Document.all("Login").Click
Do Until Not oIE.Busy
DoEvents
Loop
oIE.Visible = True
oIE.Document.all("txtpassword").Value = "password" ' This gives an "object
not set" etc. error
End Sub

The Login button displays a popup which I've no idea how to 'grab hold of'
to pass the password/login info.
The oIE variable still contains the original web page object.

The Source should give me some clues, but I haven't a clue.

Any help would be greatly appreciated.

Cheers

Dave F.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default This is not strictly excel, but I am running it from an excel macro

Dave,

If you have the login page up then this will log you in. No idea
what's next, since I wasn't able to log in myself.. ;-)

Tim.


Sub LogMeIn()
Dim o As Object

Set o =
GetHTMLDocument("http://extranet.4projects.com/popuplogin.asp?")

If Not o Is Nothing Then
o.getElementById("txtLogin").Value = "username"
o.getElementById("txtpassword").Value = "password"
o.getElementById("submit1").Click
End If

End Sub

'Find an IE window with matching location and get the document from
' the loaded page. Assumes no frames.
Function GetHTMLDocument(sAddress As String) As Object

Dim objShell As Object, objShellWindows As Object, o As Object
Dim retVal As Object, sURL As String

Set retVal = Nothing
Set objShell = CreateObject("Shell.Application")
Set objShellWindows = objShell.Windows

For Each o In objShellWindows
sURL = ""
On Error Resume Next
sURL = o.Document.Location
On Error GoTo 0
If sURL < "" Then
If sURL Like sAddress & "*" Then
Set retVal = o.Document
Exit For
End If
End If
Next o

Set GetHTMLDocument = retVal
End Function



"Dave F." wrote in message
...
Hi

I anyone knows a better NG to get an answer, please let me know.

Anyway... I'm trying to load a password protected web page:

http://extranet.4projects.com/

This is as far as I've got:

Sub Projects_4()
Dim oIE As New SHDocVw.InternetExplorer

Set oIE = New SHDocVw.InternetExplorer
oIE.Navigate "http://extranet.4projects.com/ "
Do Until Not oIE.Busy
DoEvents
Loop
oIE.Document.all("Login").Click
Do Until Not oIE.Busy
DoEvents
Loop
oIE.Visible = True
oIE.Document.all("txtpassword").Value = "password" ' This gives an
"object
not set" etc. error
End Sub

The Login button displays a popup which I've no idea how to 'grab
hold of'
to pass the password/login info.
The oIE variable still contains the original web page object.

The Source should give me some clues, but I haven't a clue.

Any help would be greatly appreciated.

Cheers

Dave F.




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
Error in Excel 97 when running Excel 2000 macro ExcelMonkey[_165_] Excel Programming 0 September 22nd 04 05:02 PM
Error in Excel 97 when running Excel 2000 macro ExcelMonkey[_164_] Excel Programming 1 September 22nd 04 04:07 PM
Error in Excel 97 when running Excel 2000 macro ExcelMonkey[_163_] Excel Programming 1 September 22nd 04 03:33 PM
Error in Excel 97 when running Excel 2000 macro ExcelMonkey[_162_] Excel Programming 1 September 22nd 04 02:53 PM
Launch Macro in Access via Macro running in Excel??? dgrant Excel Programming 1 September 24th 03 01:38 PM


All times are GMT +1. The time now is 04:56 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"