Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default Whats wrong with my code? This is a real challenge...

I can't seem to figure out how to set the value of the following combo
box on the following website...

http://babelfish.altavista.com/

The combo box controls the translation language combobox and it is
called "lp" but when I refrence it in VBA I get error messages... My
code...

Private Sub CommandButton5_Click()
WebBrowser1.Document.All("lp").value = 36 'Spanish to English
End Sub

I have also tried using the refrenced value...

Private Sub CommandButton5_Click()
WebBrowser1.Document.All("lp").value = "es_en" 'Spanish to English
End Sub

Any help is greatly appreciated!!!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Whats wrong with my code? This is a real challenge...

Try:

WebBrowser1.Document.frmTrText.lp.selectedIndex = 35 'index is zero-based

Tim

wrote in message
...
I can't seem to figure out how to set the value of the following combo
box on the following website...

http://babelfish.altavista.com/

The combo box controls the translation language combobox and it is
called "lp" but when I refrence it in VBA I get error messages... My
code...

Private Sub CommandButton5_Click()
WebBrowser1.Document.All("lp").value = 36 'Spanish to English
End Sub

I have also tried using the refrenced value...

Private Sub CommandButton5_Click()
WebBrowser1.Document.All("lp").value = "es_en" 'Spanish to English
End Sub

Any help is greatly appreciated!!!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default Whats wrong with my code? This is a real challenge...

On Feb 5, 2:43*am, "Tim Williams" <timjwilliams at gmail dot com
wrote:
Try:

WebBrowser1.Document.frmTrText.lp.selectedIndex = 35 *'index is zero-based

Tim

wrote in message

...



I can't seem to figure out how to set the value of the following combo
box on the following website...


http://babelfish.altavista.com/


The combo box controls the translation language combobox and it is
called "lp" but when I refrence it in VBA I get error messages... My
code...


Private Sub CommandButton5_Click()
WebBrowser1.Document.All("lp").value = 36 'Spanish to English
End Sub


I have also tried using the refrenced value...


Private Sub CommandButton5_Click()
WebBrowser1.Document.All("lp").value = "es_en" 'Spanish to English
End Sub


Any help is greatly appreciated!!!- Hide quoted text -


- Show quoted text -


Tim,

Thank you so much!! I would have never figured that one out. I
don't understand the logic behind the code but I know it works...

Could you please tell me where

frmTrText

came from?

Thanks again!
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Whats wrong with my code? This is a real challenge...

Form elements can be referenced like this:

document.formname.elementname

frmTrText is the name of the form which contains the list.

Tim


wrote in message
...
On Feb 5, 2:43 am, "Tim Williams" <timjwilliams at gmail dot com
wrote:
Try:

WebBrowser1.Document.frmTrText.lp.selectedIndex = 35 'index is zero-based

Tim

wrote in message

...



I can't seem to figure out how to set the value of the following combo
box on the following website...


http://babelfish.altavista.com/


The combo box controls the translation language combobox and it is
called "lp" but when I refrence it in VBA I get error messages... My
code...


Private Sub CommandButton5_Click()
WebBrowser1.Document.All("lp").value = 36 'Spanish to English
End Sub


I have also tried using the refrenced value...


Private Sub CommandButton5_Click()
WebBrowser1.Document.All("lp").value = "es_en" 'Spanish to English
End Sub


Any help is greatly appreciated!!!- Hide quoted text -


- Show quoted text -


Tim,

Thank you so much!! I would have never figured that one out. I
don't understand the logic behind the code but I know it works...

Could you please tell me where

frmTrText

came from?

Thanks again!


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
Whats wrong with my code? [email protected] Excel Programming 4 May 3rd 07 03:47 AM
Whats wrong with this code? Steve[_73_] Excel Programming 2 January 31st 06 04:13 PM
Whats wrong with this code? Joseph[_54_] Excel Programming 2 November 26th 04 04:31 PM
whats wrong with this code LiSa Excel Programming 2 September 8th 04 05:47 PM
Whats wrong with this code gav meredith Excel Programming 5 April 21st 04 12:01 AM


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