Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Yes, thank you very much. I was able to make it work myself in the same way.
The Do While ie.busy And Not ie.readystate = 4 DoEvents Loop is the interesting trick. It works really well and I will use it a lot. Regards, Antonio "SyrNO" wrote: Not a problem, Antonio Here's the setup: I work for a bank that receives a spreadsheet of Vehicle information including VIN, Year and Make of the vehicle. There's a website we have to go to and check for information about this vehicle. Instead of manually typing the information in (time consuming and potential typing errors), I was asked to design a macro that would open the site and populate the text fields with proper data. VIN information is Column A, Year is Column B and Make is Column C. Sub LookUpOnInternet() Dim VIN As String Dim CurrentRow As String Dim YR As Integer Dim MAKE As String Dim ie As Object CurrentRow = ActiveCell.Row VIN = Range("A" & CurrentRow).Value YR = Range("B" & CurrentRow).Value MAKE = Range("C" & CurrentRow).Value Set ie = CreateObject("InternetExplorer.Application") ie.navigate "https://corvus.dmv.state.ny.us/titlstat/iviqEnterVehInfo.cfm" Do While ie.busy And Not ie.readystate = 4 DoEvents Loop ie.Visible = True SendKeys "{TAB}", True SendKeys "{TAB}", True SendKeys VIN SendKeys "{TAB}", True SendKeys YR SendKeys "{tab}", True SendKeys MAKE End Sub "Antonio" wrote: Hi SyrNO, Could you post the full code? I am very interested in passing data to IE. Many thanks, Antonio "SyrNO" wrote: I got it. Was checking out www.ozgrid.com and found the following bit of code that basically says, "until the browser is ready, busy yourself". THEN, I am able to use SENDKEYS to move to the necessary textboxes and send the variable data. Set ie = CreateObject("InternetExplorer.Application") ie.navigate "https://www.anywhere.com" Do While ie.busy And Not ie.readystate = 4 DoEvents Loop ie.Visible = True works like a charm :-)) "SyrNO" wrote: I'm trying to write code that will assign data in 3 cells to 3 variables, i.e. - strVIN = activecell.offset(0,-3).value strDate = activecell.offset(0,-2).value strName = activecell.offset(0,-1).value Then, I want to open an Internet Browser window (user's default browser), navigate to a specific website (I have this part down), and then place the values of my 3 variables into 3 text boxes on the website. I tried SendKeys using the Tab key and then the variables. Problem with this is the timing of the action. If the browser window doesn't open soon enough, the data is pasted in the active cell in Excel. How can I consistently paste the information in the proper browser locations every time? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Send Key to open a particular internet browser | Excel Worksheet Functions | |||
Close an Internet Explorer browser window | Excel Programming | |||
Excel macro error when opened in internet browser | Excel Programming | |||
Passing a dataset from jsp to browser excel plugin | Excel Programming |