View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tim Williams Tim Williams is offline
external usenet poster
 
Posts: 1,588
Default VBA to make key entries into application

More....

for most applications you can use "getObject()" to return a running
instance. Not possible with IE so here's a way to do the same thing.
In one way it's an improvement on GetObject since you can select which
instance you want to work with, based on the URL of the currently-loaded
page.

Tim.



Sub test2()
Dim o

Set o = GetIE("http://www.yahoo.com")

If Not o Is Nothing Then
MsgBox o.document.body.innerHTML
Else
MsgBox "No Yahoo page found"
End If

End Sub


Function GetIE(sLocation As String) As Object

Dim objShell As Object, objShellWindows As Object, o As Object
Dim sURL As String
Dim retVal As Object

Set retVal = Nothing
Set objShell = CreateObject("Shell.Application")
Set objShellWindows = objShell.Windows

For Each o In objShellWindows
sURL = ""
On Error Resume Next
'check the URL and if it's the one you want then
' assign it to the return value
sURL = o.document.Location
On Error GoTo 0
If sURL Like sLocation & "*" Then
Set retVal = o
Exit For
End If
Next o

Set GetIE = retVal

End Function




"KENNY" wrote in message
...
It is a propietary (still in development) office
management system (web based). I think the steps are Copy
from a cell in Excel, go to destination app, paste, and so
on ..... back and forth.

Thanks.


-----Original Message-----
KENNY,
What is the "destination application" ?

NickHK

"KENNY" wrote in

message
...
Hello,

I'd love to be able to take data from an Excel worksheet
and place it ("key")into another application. For

example:

Column A Column B Column C
Name Address Phone

Bob 123 Main 612-123-4567
Joe 456 Elm 555-123-9876



The mechanics would be enter A2 data, go to new field in
destination application, enter B2 data, go to new field,
enter C2 data, click SAVE in destination application,
click NEW, and start process over for row 3 (Joe)....

I know some VBA, and a little about .bat files. Any

help
getting me started would be greatly appreciated

TIA!



.