473,385 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

On webUI, it is unable to click second button after first click in VBA?

2
It doesn't have id element into second button elements except type, value and onclick;

Below is my webUI code

Expand|Select|Wrap|Line Numbers
  1.  
  2. <input type="button" value="Download onclick="javascript:__doPostBack('GridView1','Account_number$0')"> 
Below is my VBA code

Expand|Select|Wrap|Line Numbers
  1. Dim htmlDoc As HTMLDocument 
  2. Dim MyBrowser As InternetExplorer  
  3. Dim MyHTML_Element As IHTMLElement  
  4. Dim myURL As String  
  5.  
  6. On Error GoTo Err_Clear  
  7. myURL = "url......................."  
  8. Set MyBrowser = New InternetExplorer  
  9. MyBrowser.Silent = True  
  10. MyBrowser.Navigate myURL
  11. MyBrowser.Visible = True
  12. Do
  13. Loop Until MyBrowser.ReadyState = READYSTATE_COMPLETE
  14. Set htmlDoc = MyBrowser.Document
  15.  
  16. htmlDoc.all.txtAccNo.Value = "0" & "" & TextBox2.Value 
  17. htmlDoc.all.ddlReasons.Value = "1"
  18. htmlDoc.all.txtRequester.Value = TextBox3.Text 'Enter your password here
  19. htmlDoc.all.txtMobNo.Value = "0" & "" & TextBox1.Value
  20. htmlDoc.all.txtLandLine.Value = ""
  21. htmlDoc.all.txtEmailAdd.Value = Range("E15")
  22. htmlDoc.all.ddlRelation.Value = "3"
  23. htmlDoc.all.button1.Click 
error in blow script of second button
Expand|Select|Wrap|Line Numbers
  1.  
  2. htmlDoc.getElementsByXpath("input[type=""button""]").Click 
Please help me, how to automate second JS button?
Sep 18 '15 #1
0 1060

Sign in to post your reply or Sign up for a free account.

Similar topics

14
by: Sinity | last post by:
Anyone knows the method/codes to disable the clicked button after first click by using .aspx-- to prevent people to click many time when waiting for the server response. I tried to do this by...
2
by: Danny Wang | last post by:
HI, I have a dialog (window) with a drop-down list and an OK button. When user clicks the drop-down list, the app need to do some calculation and validation, so I put an Text_on_change event on...
2
by: roni | last post by:
hi. what im doing is replacing user control in dyanamic way,with page.loadcontrol. after i replace , when i click on the first time on button, there is no respond. only the second click get...
3
by: PJ6 | last post by:
I've added a button to a class inheriting from System.Web.UI.Control and want to handle (pass on) its click event to the page that contains it. Coming from a WinForms background, I thought this...
5
by: TS | last post by:
for some reason, it posts to the server, but no click events of any buttons on form fire. the button is the first one on the form. when the focus is inside the textbox, it doesnt' work. if i click...
5
by: =?Utf-8?B?dGhlZ3JlZW5vbmU=?= | last post by:
situation: when i click capture button i need to capture a weight everytime i hit it (5 fields to fill) pluse incriment a counter to let me know which field to fill. I need a code skelaton. --...
6
by: user | last post by:
Hello, With ASP.NET2, how to program a button's click ? For example, I have two button and when i click the first one, i would like that the second one will be click too (by programming) ......
4
by: landolakes | last post by:
Hi. I have two forms. The first, designed some time ago, is just a report request form and has a combo box to select a workorder, click "Run Report" (cmdRunReport), and the user gets a status...
2
by: William | last post by:
Hi I've created a page with only 'n blank table control on it. When clicking a button, the table populates with various textboxes and dropdown lists to make up a complete form. In the last row...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.