Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Passing Data to Internet Browser

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 125
Default Passing Data to Internet Browser

Well you can't with the way your going about it Excell VBA can interface with
some windows applications but I don't think that it was ment to the way your
trying to do it seem's like the hard way.

I would suggest using VBS (Visual Basic Script) in conjunction with you
Excell to accomplish this. Although if you are not firmilar with VBS this
could poise a problem.

Unfortuanitly I am not firmillar enough with VBS to show you how to do this
with a code example.


"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?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Passing Data to Internet Browser

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?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default Passing Data to Internet Browser

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?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Passing Data to Internet Browser

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?



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default Passing Data to Internet Browser

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?

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
Send Key to open a particular internet browser sunspot27 Excel Worksheet Functions 0 July 16th 09 12:31 PM
Close an Internet Explorer browser window [email protected] Excel Programming 1 July 5th 04 06:25 PM
Excel macro error when opened in internet browser Dee Excel Programming 0 April 19th 04 11:16 PM
Passing a dataset from jsp to browser excel plugin JM Patton Excel Programming 0 September 11th 03 09:22 PM


All times are GMT +1. The time now is 11:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"