Download Excel from .msg file saved in a folder?

Hello All,

I have one .msg file in my folder. I want to download the attached excel from the file.

@Irina_Butu I am also getting the same error u faced. Not have permission to open the folder or file is already open.

Can you please help how u resolve this issue.

Thanks,

Please post screenshots of your workflow with error message.
It will help to troubleshoot the issue further.

  1. msg file is saved by user or by bot?
  2. bot is doing any kind of work on msg file like renaming, moving etc before it tries to extract the attachment ?

User will provide the file and save into the specific folder.
Bot will find the .msg file and download the excel file from it.

The very first run for that file is working fine right…?
Just from there after you start to have issue with permission or file already open ?

Most probably Outlook is not releasing msg file once the code is entirely executed (The very first run).
I would recommend to copy msg file from shared drive to local drive with time stamp (HHmmss) and refer that to extract attachment. It should work as every time bot/outlook will be referring a new file.
You can also try to close the outlook once extraction is done for file (I hope Outlook will release the lock on that file at time of exiting/quitting)

Let us know if this work for you.

@Sonam_N,

Try this solution.

Hi ashokkarale

Thanks for the reply.

Getting error Invoke Code: No compiled code to run
error BC30311: Value of type ‘String’ cannot be converted to ‘MailMessage’. At line 6

I am using this code for .msg file.

Thanks

@Sonam_N,

Check the datatype are being used correctly.