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

Hi Kenny

Here's a way of typing:

Sub test()
Dim R As Long
Dim C As Long
Dim V As Long
V = Shell("C:\WINDOWS\NOTEPAD.EXE", 1)
DoEvents
Application.Wait Now + TimeSerial(0, 0, 1)
For R = 1 To 2
For C = 1 To 3
Application.SendKeys Cells(R, C).Value
Application.SendKeys "{TAB}"
Next
Application.SendKeys "{RETURN}"
Next
End Sub

Note that this is /not/ a good way to automate one application from another.
Sendkeys is like typing blindfolded and can be used reliably only in
strictly controlled environments.

Can this "another application" import files ? Looks like some database
thing, it should handle an import from Excel or from a textfile.

HTH. Best wishes Harald

"KENNY" skrev i melding
...
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!