473,386 Members | 1,734 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,386 software developers and data experts.

Using Access 2007 to automate Internet Explorer issue with drop down box selection

8
I have data that sometimes needs to be uploaded to a 3rd party website and I’m trying to automate this process with Access 2007. I’m having a difficult time with my VBA syntax and with identifying the HTML names/id’s of objects I want to control.

I have referenced Microsoft HTML Object Library & Microsoft Internet Controls and should note the version of Internet Explorer my company currently uses is IE6 (I know can’t wait for an update)

Here is my current code:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Testing17_Click()
  2.  
  3. On Error Resume Next
  4.  
  5. Dim IE As Object
  6. Dim document, element
  7. Dim btn As HTMLButtonElement
  8.  
  9. Set IE = CreateObject("internetexplorer.application")
  10.  
  11. IE.Navigate "https://www.quickbase.com/db/bc68fkzzg?a=ImportExport"
  12. IE.Visible = True
  13.  
  14. While IE.busy
  15. DoEvents
  16. Wend
  17.  
  18. For Each btn In IE.document.all.tags("Input")
  19. If btn.Value = "ImportClipboard" Then
  20. Call btn.Click
  21. End If
  22. Next btn
  23.  
  24. While IE.busy
  25. DoEvents
  26. Wend
  27.  
  28. End Sub
  29.  
The code above simply opens an instance of IE and navigates to the site (it does have a log in I think but I have my browser set to auto login) and selects a radio button for the Option ImportClipboard however there is a drop down box in which I need to select Reservations and this is the point I'm stuck at. I don't know the proper syntax to use and I tried using the above code with variations such as:

Expand|Select|Wrap|Line Numbers
  1. For Each btn In IE.document.all.tags("Select")
  2. If btn.Value = "Reservations" Then
  3. Call btn.Click
  4. End If
  5. Next btn
  6.  
But nothing happens (and no error messages). I'm wondering if I should be using a click for the dropdown selection as well.

I’ve followed the instructions from this site (http://www.tek-tips.com/faqs.cfm?fid=6399) and pasted into excel and will include in an attachment (I’ve highlighted the row in green that I think has the pertinent info). I've also attached some of the HTML from the site on the additional pages if that helps.

Also any reference sites/links anyone can suggest that a beginner could follow I'd appreciate it as I've found several similar issues for excel but nothing specific for dropdown boxes or a list of Internet Controls for Access.
Apr 28 '10 #1
1 5014
JMANTN
8
Hate to reply to my own thread but in case anyone else comes across this figured I'd show the code that worked for me which took me two days and a lot of trial and error...



Expand|Select|Wrap|Line Numbers
  1. Private Sub Testing17_Click()
  2.  
  3. On Error Resume Next
  4.  
  5. Dim IE As Object
  6. Dim document, element
  7. Dim btn As HTMLButtonElement
  8.  
  9. Set IE = CreateObject("internetexplorer.application")
  10.  
  11. IE.Navigate "https://www.quickbase.com/db/bc68fkzzg?a=ImportExport"
  12. IE.Visible = True
  13.  
  14. While IE.Busy
  15. DoEvents
  16. Wend
  17.  
  18.  
  19. For Each btn In IE.document.all.tags("Input")
  20. If btn.Value = "ImportClipboard" Then
  21. Call btn.Click
  22. End If
  23. Next btn
  24.  
  25. While IE.Busy
  26. DoEvents
  27. Wend
  28.  
  29. 'This is what selects the table and then the element in the drop down/combo box
  30. IE.document.all.Item("table").Value = "bc68fkzzi"  
  31.  
  32. Set IE = Nothing
  33.  
  34. End Sub
Apr 29 '10 #2

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

Similar topics

2
by: Kate Gibbs | last post by:
I need to write a simple utility in VB.NET that reads an Excel file, gets some data from a sheet, then...it needs to automate internet explorer in a robot manner. I know that Application Centre...
2
by: Sybre | last post by:
I have a script which reads a file and generates a list for a drop-down selection box. However, I want to be able to change which option is selected when certain buttons are clicked - how can I do...
0
by: satish | last post by:
Hi all, how to automate internet explorer for login and repetitive task using vb.net or c# can anyone provide me links to such websites for free tutorials and source code. Satish
1
by: bvlmv | last post by:
Hello, relatively new to programming and just trying to create a simple asp page. I have the following drop down menu on a html page and when submitting i would like to call out on asp what someone...
6
by: bvlmv | last post by:
Hello, relatively new to programming and just trying to create a simple asp page. I have the following drop down menu on a html page and when submitting i would like to call out on asp what...
2
by: bbatson | last post by:
Hello, Does anyone have any advice as to how to limit a drop-down selection in a table? For example, suppose I have two tables - essentially a one-to-many relationship. One table is...
3
by: brat33 | last post by:
I am trying to use a command button to automate a process for creating mailing labels from a query in Access 2007, going into word 2007. Current code looks like the following: 'Start MS Word Dim...
0
by: So Confused | last post by:
I have a drop down selection menu on an HTML form. I want to display 1 answer, for a few selection options.... and another answer for the rest of the options. Example code is below: How Much...
0
by: Alex Fung | last post by:
When I use GotFree Cards (http://www.got-free-ecards.com) to send free e-cards, I come across a problem when selecting the future date for sending the card. The webpage uses javascript and the...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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.