Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default How to use SendKeys to interact with Internet Explorer???

Hey all,
I'm working on a program that must navigate through a website which I
have not designed myself. I have created a wait function which reloads
when the server hangs and the page comes up blank. The problem is the
dialog box that occurs when you try to reload. I've been researching
this little problem for a few weeks now, and the most common suggestion
in the internet.explorer.scripting group, is to use the get method
rather than the post method, however since I did not design the site,
this is something that I cannot change (I think, correct me if I'm
wrong on this, please).
I'm sure there must be a way of accessing the dialogbox object and
clicking the retry button, however I don't know the DOM well enough to
figure that one out entirely on my own (but if you have actually done
this and had it work, please share!!! :)).
So I'm left with trying to use the SendKeys method of trying to close
this way to annoying dialog box. Only I must be implementing it wrong,
because either it sends the "{Enter}" key command to my macro window,
and when I manually break execution, I find hundreds of carriage
returns in my code, OR the version I currently have and will post, I
just get an error saying this object or method is not supported. As
this looks like the most promesing avenue of trying to accomplish what
I'm doing, I would sure appreciate any help by those of you have
successfully used SendKeys from Excel to interact with Internet
Explorer.
I think I'm just doing something really dumb btw, in termas of creating
a variable for it... but I'm not sure and have spent the last two days
trying everything I could think of.... so if there's ANYONE out there
who can help....
:oD
Thanks,
Mike

'[CODE SECTION]==============================================
Sub waitForPageLoad()
Dim IExp As InternetExplorer
Dim browserwindow As InternetExplorer
Dim refreshTime As Variant

Set IExp = GetObject(, "InternetExplorer.Application")
Set browserwindow = IExp

refreshTime = Now + TimeValue("0:00:30")
Do Until browserwindow.ReadyState = 3
If Now = refreshTime Then
browserwindow.Stop
browserwindow.Refresh
'This is the problem here...
IExp.SendKeys "{Enter}" 'Run-time error "438": Object doesn't

'support this property or method.

refreshTime = Now + TimeValue("0:00:30")
End If
Loop

Do Until browserwindow.ReadyState = 4
Loop

End Sub

'[END CODE]===============================================

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
Internet Explorer da Excel Discussion (Misc queries) 4 October 9th 08 09:31 PM
internet explorer instance Manoj Excel Discussion (Misc queries) 0 February 1st 06 09:56 AM
Interaction with Internet Explorer PaulD Excel Programming 7 February 5th 05 07:27 PM
Internet Explorer & Excel David Excel Programming 0 February 4th 05 08:51 PM
internet explorer doris Excel Discussion (Misc queries) 1 January 5th 05 09:44 PM


All times are GMT +1. The time now is 09:14 PM.

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"