Trouble with a send key macro

Closed
wraith373
Posts
4
Registration date
Friday July 26, 2013
Status
Member
Last seen
July 27, 2013
- Jul 26, 2013 at 06:22 PM
wraith373
Posts
4
Registration date
Friday July 26, 2013
Status
Member
Last seen
July 27, 2013
- Jul 27, 2013 at 10:00 PM
i am trying to get a sendkeys macro in excel to send a string of keystrokes to another program and repeat ten times. the macro i have now will send the string once but i cant seem to get it to go farther then that. here is what i have so far,

Sub test()
'
' test Macro
' test
'
AppActivate ("NALCOMIS IMA - [MAF List]")
SendKeys ("vjam3~c")

End Sub

it is a string of hotkeys with slight data entry so a [processNow ] or something like that may be required so as not to overload the database. thanks in advance for the assistance.

5 replies

Blocked Profile
Jul 26, 2013 at 08:05 PM
wow...what a fascinating question....


I really dont think i have seen send keys as a solution, well a viable one, in 10+ years! You would think that one would not need to emulate a keyboard stroke with all of the API nowadays.....unless of course...I have really misunderstand the need for such a processor intense command.

So, i need more info on how far you are, without the commented out test lines that may or may not actually call a module (or subroutine) called Macro, in order to answer.

I'd love to help, because I havent used Dynamic Data Link in years!
0
wraith373
Posts
4
Registration date
Friday July 26, 2013
Status
Member
Last seen
July 27, 2013

Jul 27, 2013 at 11:57 AM
Ok, the system I am using is 10+ years old. It is a database that handles and tracks all the work orders that I am currently involved in. Every day I have to update the status of the workorders. What I'm trying to do is get some way to change them all without manually up dateing each individually. So i pull up the list of workorders then The commands are as follows.
V pulls up the first order on the list.
J selects the job status screen of the work order I need to update
A pulls up a popup to add a status and automatically selects the field I need to fill
M3 is the status I am inputting
~ could be replaced with{ENTER} saves the update and closes the popup
C closes that workorder pulling up the listing of all the orders that haven't been updated yet.

With the exception of the status update the whole process could also be done by mouse.
0
Blocked Profile
Jul 27, 2013 at 06:29 PM
This is really tough, because the code would have to know the "name of the window" make it an object , then "poke" some values.....let me ask some questions...

What Database? Can you record a macro? If it is Excel, then record a macro!

Do you have a command line to write your own SQL to change the value of the data, something like: "UPDATE tblproject.status= M3 WHERE DATE = TODAY;"

Unless the program is written with something with a "hook", what you are asking is a completely custom program, at $1750(US) a day(8 hour)!


You can change you de code and chop it up and put :
DoEvents
Sleep 4000 'puts a 4000 unit delay into code
DoEvents

-in between each keystroke!



I'm done with this site. I came here for help, helped while I was waiting, and I have had my hand slapped for walking on toes, but I still get walked on! Have fun Unlocking Facebook and DL WHATSAPP!
0
wraith373
Posts
4
Registration date
Friday July 26, 2013
Status
Member
Last seen
July 27, 2013

Jul 27, 2013 at 09:48 PM
The database is NALCOMIS. Used by Marine aviation maintainence crews.
As far as I know there is no way to save a macro in that program. I have gotten excel sendkeys macros to work in the past and that is why I am trying this way now. I know excel has a way to buffer the key strokes and allow the other program to catch up before continuing, but I don't know how to use it. I tought my self excel macros by looking at examples and seeing how they worked... I haven't seen one that had a wait command so I have no idea how to write that command into code.
0

Didn't find the answer you are looking for?

Ask a question
wraith373
Posts
4
Registration date
Friday July 26, 2013
Status
Member
Last seen
July 27, 2013

Jul 27, 2013 at 10:00 PM
So, now that I know what I am looking for.... This is what I have, I'm not at work right now so I have no way to test it but let me know if it looks good.


,

Sub test()
'
' test Macro
' test
'
AppActivate ("NALCOMIS IMA - [MAF List]")
SendKeys ("vjam3~c")
Do
Calculate
Sleep (1000) ' delay 1 second

Loop
End Sub
0