PDA

View Full Version : Need Help with Internet Automation (Part 1)!!!



23izkool
04-07-2011, 05:34 AM
Hi all,

I have been at this problem for close to a year and finally got some headway but stuck at the last leg. Appreciate that someone can help me with this!

OBJECTIVE OF THE MACRO (BASICALLY INTERNET FORM FILLING)

Open up multiple websites through the multiple weblinks recorded in a spreadsheet
Click the relevant buttons & copy some numerical figures from the spreadsheet into the websites, then click on the submit button in the websites to upload the figures
PROBLEMS

Unable to write the macro to upload figures from the spreadsheet
The fields to fill belong to ‘hidden input’ type
Unable to access it like what was done for clicking edit button & submit button
Currently used an alternative à use ‘sendkeys method’ to (1) tab through the other fields in the website, (2) copy figures from the spreadsheet, (3) paste into the empty field which was tabbed to
However, sendkeys are very unstable & sometimes tab to the wrong field!
Will give more elaboration below!


ACTUAL WEB LAYOUT

(Fig 1 / Before clicking ‘Edit’ Button)
http://www.host-images.com/u/files/r0gabecv06mgh8gyh08w.jpg

(Fig 3 / Key in empty fields & Click ‘Yes’ Button)
http://www.host-images.com/u/files/w3jjzk3zvrwcmsrhxm1g.jpg

(Fig 4 / Figures will be populated to main screen à click ‘save’)
http://www.host-images.com/u/files/fc7ss3fu9zigi0i7bzw0.jpg


THE SPREADSHEET DATA FROM WHICH FIGURES ARE PICKED TO FILL THE EMPTY FIELDS IN THE WEBSITE


(Figure 5 / Table in Spreadsheet)
http://www.host-images.com/u/files/crpyd8jbp3arq8wi40vf.jpg

So as I run the macro from the spreadsheet, it will:
(1) open up URL for Sector 1 à work within the webpage for Sector 1
a. click the green ‘Click here to edit’ button
b. click the red arrow to bring out the PopUp box (Red) for Branch1
c. fill in all the empty fields for Branch 1 (the empty fields for ‘Total Revenue’ & ‘Total Cost’)
d. click the green ‘Yes’ button à this will close the PopUp box & upload the figures to the empty fields (as in Fig 4)
e. click the green ‘Click here to save’ button (as in Fig 4)
(2) re-run the macro through a for-loop so that it repeats all the steps above to work on URL for Sector 2

PROBLEMS
· Without using sendkeys, I am unable to get the macro to upload the figures into the empty fields à the macro just stops & runs into errors because I do not know how to write to access the hidden input (I think)
· Even when using sendkeys, it is very unstable à the macro updates the wrong figures, e.g. Total Revenue = 1 instead of 3 for Branch 1 (inputted the Total Cost instead). Using the above example, I am tabbing 6 times to get to the re
· PLEASE HELP WITH THIS!!!!
· I have put in the relevant source code & the existing macro below. Hope someone can advise!

23izkool
04-07-2011, 05:36 AM
http://www.host-images.com/u/files/l1tgpr9yi2yijmmvanso.jpg
http://www.host-images.com/u/files/d5w0hzl1xbkggjwkug38.jpg
http://www.host-images.com/u/files/076ld12duxoc5qd0k1ze.jpg http://www.host-images.com/u/files/7uml7tqfj2awdnz3kwye.jpg