I want to read outlook subject and store into excel ,but it gives me error .when I store it into message box so it gives me correct result.
but I want to store it into excel.
Use Write cell activity inside Excel Application Scope activity.
Can you please help me with what is the exact error that you are getting. Without Error it is difficult to provide solution.
I use it .and give the range in write cell, like A2 to A4 but bot is writing the one unread mail to the 4 rows in the excel.Main.xaml (8.6 KB)
Because you specified range like this: “A2:A7”. That’s why.
Take one variable of type Integer and say ‘Index’ and initially assign 2 to it. And pass it to write cell like below:
And then increment Index value.
are you trying to add each Mail subject in a separate cell. if this is the case i changed the flow. please check it and let me know it is working or not.
Main (1).xaml (10.9 KB)
Instead of Write Range use Write Cell activity.
Now its working fine…
Glad that it helped you to solve your problem. Can you please mark this thread as solved by clicking on the post which helped you.
i want to get the new outlook message and append into excel file but previous data should exist.
so I applied append activity instead of write range activity but it gives me error.
What is the error that you are getting …??
error-string can not be converted into system.data.datatable .
when I am using append activity
While appending data to excel what is the variable data type ??? It should be of DATATABLE datatype. Please check the data type of the variable that you are using in side APPEND RANGE.
I used variable.subject.tostring.
and I am not able to understand that what should I use instead of to string?
You can’t add variable.subject.tostring ==> This is of String data type.
and Append Range will accept only Datatable.
Can you please share your workflow ? i will change and check it from my side.
Changed the flow. Instead of Write Range i used Write Cell activity.
- Read all rows from Sheet1 (Assume 5 rows are there)
- Get Row count (Row count = 5)
- Increase Row Count by One.(Row count = Row count + 1(6))
- Use Write Cell Activity to write the data.(“A” +Row count = “A6”)
Attached workflow. Please check and let me know it is working or not.
Main.xaml (14.7 KB)
I am hoping that the solution i provided is working fine.
If this is resolved please mark above post as solution so that it will help others.