Home > Blockchain >  VBA Excel - Interacting with Attachmate EXTRA - Recognizing if there are no results
VBA Excel - Interacting with Attachmate EXTRA - Recognizing if there are no results

Time:08-03

I am designing a workbook in excel that I will put a list of accounts that I want to run a loop that will pull up Attachmate and search for data on the account. If there is no data, the results are empty, it doesn't report back "no data" or anything like that. So if there is data, I need it to return a positive, but if the information is blank I need it to return negative. Is there anyone that has experience with both attachmate, excel, and vba has any thoughts on how I could run that loop?

CodePudding user response:

Basically what we do with AttachMate Extra Excel VBA is: after instantiating the Attachmate Extra COM interface, log into one of the available systems>Access a specific resource of that system (Sendkeys, etc), wait for completion, read one (or more ) character array specific fields (1 to 24 lines)*(1 to 80 columns) and then guide the code accordingly. So what you need to do is read the character array where the status of the intended access is normally returned. For this it is necessary to know the (possible) various return screens of this system. Once you know where to read the return, load it into a text variable, and this will serve to guide code execution.

An example:

strMsg = Trim(oScreen.Area(22, 1, 22, 79, xBlock))

Line 22 was read, from 1 to the character at position 79. From there, the code will follow as interpreted. The possible return messages must be known in advance, in order to achieve greater success in building the logic.

It is very important to build a routine that waits for the response from the OiA object. Oia is the object that flags that the required task has been completed. Using it, your code becomes more productive and assertive. A blank return could, who knows, also mean a system down.

CodePudding user response:

So I am not quite sure why folks are down voting as this seems like a fair question. But for those of you looking for an answer, I found:

Sess0.ReadScreen NoDataChk, 1, iRow, 4


If NoDataCheck = " " Then
'Whatever result you need, in my case it is ResultBox = "Not Eligible"
Exit Sub
End If
  • Related