Error in PowerPoint Invoke Code

Hi guys,

I’ve put some C# code into an “Invoke Code” stage in order to open and modify a PowerPoint presentation.
Code works fine in Visual Studio 2019 after importing Microsoft.Office.Interop.Powerpoint.dll and office.dll, however in UiPath Studio it doesn’t have compiles error but when running the following exception is thrown:
error CS0012: The type ‘Microsoft.Office.Core.MsoTriState’ is defined in an assembly that is not referenced. Add refrence to assembly ‘office,
Version=15.0.0.0,
Culture=neutral,
PublicKeyToken=71e9bce111e9429c’.

In UiPath I imported Microsoft.Office.Interop.Powerpoint and Microsoft.Office.Core

Is there something else to do?

Thanks.

Hi Stefano, welcome to the forum.

You can add assembly references to your .xaml-files manually as described in this example for the DataSetExtensions reference: AsEnumerable is not a member of 'System.Data.Datatable' - #2 by loginerror

I don’t exactly know which reference you need though.

You can also try automating your PowerPoint presentation with UiPath activities. Check out PowerPoint packages and components from Go!

Cheers, Lukas

Hi Lukasz,

thanks for the answer, I’ve tried to add Microsoft.Office.Core via assembly but the error remained.
I’ve finally been able to go on by performing the following steps:

  • Create a Custom Activity that used as reference both the “office” dll, which is found in the assembly folder;
  • Imported the activity into UiPath and reloaded the project.

Don’t know if there is a simpler way to import this dll but somehow this fixes my problem.

Regards,
Stefano

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.