I want to read all the unRead mails from the mail using "Email Automation Command" and extract the 'from mail', 'subject' and insert into the excel sheet. I am able to read all the unRead mails from mail and subject but here each mail data is inserted into the separate excel file. How can i create the excel file dynamically in Automation Anywhere. Anyone help me.Thanks in Advance. Thanks, venkat.
4 Answers
- Open spresheet
- Loop through Read mail
- go to begining of row of active cell
- set value of active cell{from}
- go to one cell right to active
- set value of active cell{subject}
- go to one cell down
- end loop

- 73
- 1
- 9
There are no inbuilt commands to create an excel file. Its advised to create a VBScript which creates an excel template with your own set of fields

- 13
- 7
-
Could you please show how to do this, as the Original Poster may not know exactly how to do what you are suggesting – Jack Bashford Aug 31 '18 at 02:57
-
@JBDouble05 Do you need the VBScript to create an excel. – Naveen Muralidharan Aug 31 '18 at 03:03
-
1All I'm suggesting you do is show the Original Poster how to do what you're proposing in your answer – Jack Bashford Aug 31 '18 at 03:05
Your questions has 2 factors 1. Creating Excel file 2. Reading and writing from Email.
For first point
We cannot directly create an Excel in AA using the create file command , cause that creates a zero kb file , which inturn gets corrupted. To create an excel file there are two ways use a vbscript which will create a workbook and save it. Second is open Excel , using Open Program command in AA , pass excel as a parameter, this would open Excel , select a blank work book using manage windows control , save this workbook using keystrokes with the name that you want.
But to I would suggest to avoid these two options and instead place a template excel file, and use this file. Instead if you can use CSV life will be easy.
Now Loop part
If using Excel
1.Open Excel 2. Email automation command, Loop through unread emails. 3. Set Text A$counter$ as $EmailFrom$ system variable. 4. set text B$counter$ as $EmailSubject$ system variable.
Counter would increment based on email loop so it should write.
If using CSV. Directly log to csv Emailfrom and EmailSubject keep appending.
Please let me know if you need any more details.

- 11
- 1
Either you can keep the Template, and open it and write the data. Or if you can't keep template, then you can call python script which can create excel file or create new sheet in excel file.

- 11
- 4