I’ve started learning RPA a few weeks ago (slowly…), and I’m stuck.
I was supposed to create a sequence to automate the retrieval of email attachments from Outlook, and first I kept getting an error (For Each: Unable to cast object of type “System.Char” to type “System.Net.Mail.MailMessage”).
I double and even tripled checked and I had followed the instructions on the video to a T, but every time I debugged it, I kept getting the same error.
So I just deleted the whole all the steps as of the For Each activity and added it all again. When I debugged it, I didn’t get the error message anymore, but I noticed the folder Invoice hasn’t been created, and the attachments are nowhere to be seen.
You nave cteated the folder “Invoices”, but the error said " but I noticed the folder Invoice hasn’t been created". Are you sure about the folder? Also, can you remove the "" from "Invoices" and try again ?
The issue is with using either C# or VB windows -Legacy
This is shown on the bottom right of the project in the blue bar
Its frustrating because for the 2nd part you have to use VB, for this issue you need to use #C when creating the project.
You can also change it by following these steps
Open the “project.json” file in your preferred code editor (I used Notepad++)
Scroll down until you find “expressionLanguage”: “CSharp”,
Change “expressionLanguage”: “CSharp”, to “expressionLanguage”: “VisualBasic”,
Re-launch your project and continue with VisualBasic Legacy.
The issue is with using either C# or VB windows -Legacy. This is chosen when creating a new project, but can be changed later through notepad
This is shown on the bottom right of the project in the blue bar
Its frustrating because for the 2nd part you have to use VB, for this issue you need to use #C when creating the project
You can also change it by following these steps
Open the “project.json” file in your preferred code editor (I used Notepad++)
Scroll down until you find “expressionLanguage”: “CSharp”,
Change “expressionLanguage”: “CSharp”, to “expressionLanguage”: “VisualBasic”,
Re-launch your project and continue with VisualBasic Legacy