waitforcursor works but only in debug mode
waitforcursor works but only in debug mode
(OP)
In Excel, there are 100 records. The macro goes thru various screens to capture data, put into Excel, and post commands into Attachmate.
In one of the screens, the cursor is on 23, 7. I send a command F8 continuously until a message appears on line 24. F8 goes to the next record so the screen. Fields are the same as the last screen except for the data. If there is a message 'last record' on line 24, then it captures data on that screen and put it into the spreadsheet.
This works if I go thru each line in the code in Excel module in debug mode. But if I run it, it will do about 5 records.
Do until Sess0.screen.getstring(24,2,11)="last record")
Sess0.screen.SendKeys ("PF8")
Do Until .Screen.WaitForCursor(23, 7)
DoEvents
Loop
loop
Any help is appreciated:)
In one of the screens, the cursor is on 23, 7. I send a command F8 continuously until a message appears on line 24. F8 goes to the next record so the screen. Fields are the same as the last screen except for the data. If there is a message 'last record' on line 24, then it captures data on that screen and put it into the spreadsheet.
This works if I go thru each line in the code in Excel module in debug mode. But if I run it, it will do about 5 records.
Do until Sess0.screen.getstring(24,2,11)="last record")
Sess0.screen.SendKeys ("PF8")
Do Until .Screen.WaitForCursor(23, 7)
DoEvents
Loop
loop
Any help is appreciated:)
RE: waitforcursor works but only in debug mode
Are you posting (COPY n PASTE) your ACTUAL code? Isn't it ...
CODE
Also, does your screen display lower case "last record"?
And where's the Sess0 object on that statement?
Makes me REALLY wonder.
What about...
...and then what happens?
I think that you may have some problems!
Skip,
Just traded in my OLD subtlety...
for a NUance!
RE: waitforcursor works but only in debug mode
I have all the Sess0 object. I'm just posting the code where I think is the problem. It works fine if I change it to wait for 3 seconds instead of waiting for cursor, but I don't want to do that because it takes too long.
Do until Sess0.screen.getstring(24,2,11)="last record")
Sess0.screen.SendKeys ("<PF8>")
Do Until Sess0.Screen.WaitForCursor(23, 7)
DoEvents
Loop
loop
This screen has a lot of fields and data. When I press F8 manually, it goes to the next record with the same fields. So I can't use waitforstring or can I?..hmm. Cursor stays at 23,7.
First 5 records works fine. Sometimes it's first 10 records. It did not capture any data for the rest of the records.
RE: waitforcursor works but only in debug mode
I've used WaitForCursor with outstanding results for years.
Be sure to dot your Is and cross your Ts. Mind your Ps & Qs. Good luck!
Skip,
Just traded in my OLD subtlety...
for a NUance!
RE: waitforcursor works but only in debug mode
CODE
Skip,
Just traded in my OLD subtlety...
for a NUance!
RE: waitforcursor works but only in debug mode
Is it because the cursor on the next screen is the same location as the previous screen?
You're awesome!