Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA to make key entries into application
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! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA to make key entries into application
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! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA to make key entries into application
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! . |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA to make key entries into application
Thanks for the response.... Unfortunately, no -- it can't
be imported (yet). -----Original Message----- 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! . |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
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! . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to make Excel application GUI look better? | Excel Discussion (Misc queries) | |||
VBA: Make Excel the active application | Excel Discussion (Misc queries) | |||
Make Excel a runtime application | Excel Programming | |||
How to make Excel the Top-Most application programmatically? | Excel Programming | |||
Make Worksheet Event available application-wide | Excel Programming |