LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 191
Default VBA and Internet Explorer

Hi guys

I have a simple bit of code which opens up Internet Explorer, navigates to a
web page, selects a value from a drop down menu (options are either "Yes" or
"No") and submits the form.

The code works fine if it is selecting "Yes" however if I change it to "No"
it dosn't work. Here is my code:

Sub photo_select()

strURL =
"http://corporate1.internal.standardlife.com/phoneline/Phnline.nsf/frmStaffUpdate"
Set objIE = CreateObject("InternetExplorer.Application")
objIE.Navigate strURL
objIE.Visible = False

While objIE.ReadyState < 4
Application.Wait Now + TimeValue("00:00:01")
Wend

objIE.Document.all("kwdshowphoto").Value = "Yes"

Call objIE.Document.Forms(0).Submit

objIE.Quit

End Sub

Here is part of the source code of the internal website, which relates to
the drop down:

<table border="0" width="100%" cellspacing="0" cellpadding="0"<a
width="100%" border="0" cellspacing="0" cellpadding="0"
<tr valign="top"<td class="sectionHead" width="350"<a width="1%"<img
width="359" height="1" src="/icons/ecblank.gif" border="0" alt=""<br
My location data / PhoneLine photo</td<td class="sectionHead" <a
width="100%"<img width="1" height="1" src="/icons/ecblank.gif" border="0"
alt=""<br
<div align="right"<a href="javascript:PhonelineHelp();" class="globalNav"
title="launch phoneline help"Help</a </div</td</tr

<tr valign="top"<td width="350"<a width="1%"<img width="359" height="1"
src="/icons/ecblank.gif" border="0" alt=""<br
</td<td <a width="100%"<img width="1" height="1" src="/icons/ecblank.gif"
border="0" alt=""<br
<br</td</tr

<tr valign="top"<td class="labelText" width="350"<a width="1%"<img
width="359" height="1" src="/icons/ecblank.gif" border="0" alt=""<br
Show my photo on Phoneline :</td<td class="dataText" <a width="100%"<img
width="1" height="1" src="/icons/ecblank.gif" border="0" alt=""<br
<font size="2"
<input name="%%Surrogate_kwdShowPhoto" type="hidden" value="1"
<select name="kwdShowPhoto"
<optionYes
<option selectedNo</select
</font </td</tr

<tr valign="top"<td width="1%"<img width="359" height="1"
src="/icons/ecblank.gif" border="0" alt=""<br
</td<td width="100%"<img width="1" height="1" src="/icons/ecblank.gif"
border="0" alt=""<br
<br</td</tr

Thanks in advance
Jamie
 
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 Atishoo Excel Programming 1 October 16th 08 04:13 AM
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
Internet explorer download/XP Pro?? Maxwell-5000 Excel Discussion (Misc queries) 1 January 3rd 06 10:03 PM
internet explorer doris Excel Discussion (Misc queries) 1 January 5th 05 09:44 PM


All times are GMT +1. The time now is 10:37 AM.

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

About Us

"It's about Microsoft Excel"