Entering and Deleting values
Entering and Deleting values
(OP)
I've got this code to scrub data in Excel and input it into the mainframe accordingly. I'm wondering if there's a way to use the same code&Excel worksheet to conversely delete these values - short of filling in the Excel worksheet with a horde of spacebars, is there something else I can use what will both enter and delete values? Perhaps I am limiting myself by using PutString; is there another command I can try? Thanks!
InputHeader:
Sess0.Screen.sendkeys("<pf5>")
Sess0.Screen.WaitHostQuiet(1)
Sess0.Screen.PutString vblSheet.Cells(RowX, 2),3,12
Sess0.Screen.PutString vblSheet.Cells(RowX, 1),4,11
Sess0.Screen.sendkeys("<enter>")
Sess0.Screen.WaitHostQuiet(5)
Sess0.Screen.PutString vblSheet.Cells(RowX, 3),6,17
Sess0.Screen.PutString vblSheet.Cells(RowX, 4),6,41
Sess0.Screen.PutString vblSheet.Cells(RowX, 5),6,65
Sess0.Screen.PutString vblSheet.Cells(RowX, 6),6,90
Sess0.Screen.sendkeys("<enter>")
Sess0.Screen.WaitHostQuiet(5)
InputHeader:
Sess0.Screen.sendkeys("<pf5>")
Sess0.Screen.WaitHostQuiet(1)
Sess0.Screen.PutString vblSheet.Cells(RowX, 2),3,12
Sess0.Screen.PutString vblSheet.Cells(RowX, 1),4,11
Sess0.Screen.sendkeys("<enter>")
Sess0.Screen.WaitHostQuiet(5)
Sess0.Screen.PutString vblSheet.Cells(RowX, 3),6,17
Sess0.Screen.PutString vblSheet.Cells(RowX, 4),6,41
Sess0.Screen.PutString vblSheet.Cells(RowX, 5),6,65
Sess0.Screen.PutString vblSheet.Cells(RowX, 6),6,90
Sess0.Screen.sendkeys("<enter>")
Sess0.Screen.WaitHostQuiet(5)
RE: Entering and Deleting values
So this is not an INQUIRY screen, it is an UPDATE screen, and hitting the ENTER key in this screen UPDATES data for this screen transaction in your mainframe?
Skip,
Just traded in my OLD subtlety...
for a NUance!
RE: Entering and Deleting values
Here's something to consider with respect to
CODE
So what with Sess0.Screen.WaitHostQuiet(5)??? You don't know if 5 is too much time, which does not SEEM to matter or if 5 is too little time, in which case your program goes ahead and enters data the the emulator is not ready to process and so IT'S LOST!
Think about it. When you drive your car, you would not even think about setting a 5 second stop wait, would you? You drive up to the stop sign and STOP, wait for 5 seconds and then GO, regardless of the traffic conditions. NOOOOOOO! You wait for visual FEEDBACK. Which is what you need to do in an asynchronous screen emulator. I like to use WaitForCursor in a loop until it returns TRUE. You'll need to Screen Rest coordinated.
Skip,
Just traded in my OLD subtlety...
for a NUance!
RE: Entering and Deleting values
Yes, that's correct. We are currently using this code to input information between 4 different fields, so when the macro says <enter> the screen gets updated. Thing is...some of the information we enter becomes obsolete or expires, so we need a way of quickly removing it specific fields. Short of entering [spacebars] to clear the field, do you know of a way to delete the information with the same or a similar code, taking triggers from the Excel worksheet?
Thanks by the way, you got me again with the WaitHostQuiet - you've gotten me on that before haha, and I will be changing it...
RE: Entering and Deleting values
You need to know the length of the field on the screen. This will "clear" a 5 byte field at 3,12
CODE
Skip,
Just traded in my OLD subtlety...
for a NUance!
RE: Entering and Deleting values
RE: Entering and Deleting values
Do you see anything from your worksheet in my code?
What am I missing?
Skip,
Just traded in my OLD subtlety...
for a NUance!
RE: Entering and Deleting values
RE: Entering and Deleting values
Consider building a table in Excel that describes EVERY SCREEN that you might encounter, and then a set of routines to interpret the table, based on the screen that you are processing. Your table might look something like this...
The Name values will correspond to the Excel Table Names in row1 for you input data.
So knowing the Len of each field, you could loop thru this table and fill each field in the input table with the correct number of spaces.
O'd use this table as the basis for mapping Excel data to and screen, rather than explicitly coding each field as your code has.
I'd be doing ALL my coding in Excel VBA!!!!
Skip,
Just traded in my OLD subtlety...
for a NUance!
RE: Entering and Deleting values
CODE
RE: Entering and Deleting values
Yes, I would normally use <EraseEOF>, but I was wondering if there is a way to send that command through Excel...?
RE: Entering and Deleting values
my code does exactly that. the only difference is the way i declared the object.
you can try it this way.
CODE