How to use "Add image to slide"?

Hello,my friends
I want to add an image or a chart of excel to a PPT.And I use the “Use PowerPoint Presentation”+“Add Image/Video to Slide” to add.But it throws an exception.
Next is my sequence and the exception message.


Exception:
20.10.4+Branch.master.Sha.6a6cfd6dfbeb86aec47564af2f9465ef0bf43df4

Source: Use PowerPoint Presentation

Message: Cannot open PowerPoint

Exception Type: UiPath.Presentations.PowerPointException

RemoteException wrapping UiPath.Presentations.PowerPointException: Cannot open PowerPoint —> RemoteException wrapping UiPath.Presentations.PowerPointException: Please make sure PowerPoint is installed —> RemoteException wrapping System.InvalidCastException: Unable to cast COM object of type ‘Microsoft.Office.Interop.PowerPoint.ApplicationClass’ to interface type ‘Microsoft.Office.Interop.PowerPoint._Application’. This operation failed because the QueryInterface call on the COM component for the interface with IID ‘{91493442-5A91-11CF-8700-00AA0060263B}’ failed due to the following error: 不支持此接口 (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, IntPtr& ppTarget, Boolean& pfNeedsRelease)
at Microsoft.Office.Interop.PowerPoint.ApplicationClass.set_DisplayAlerts(PpAlertLevel DisplayAlerts)
at UiPath.Presentations.Helpers.PowerPointHelpers.StartNewApplication()
— End of inner exception stack trace —
at UiPath.Presentations.Helpers.PowerPointHelpers.StartNewApplication()
at UiPath.Presentations.Helpers.PowerPointInstanceManager.InternalComAppReferenceCountManager.StartNewApplication(Object startOptions)
at UiPath.Shared.ComAppReferenceCountManager`3.StartOrAttach(TComAppStartOptions startOptions, Boolean& wasAlreadyRunning)
at UiPath.Presentations.Helpers.PowerPointInstanceManager.StartOrAttach()
at UiPath.Presentations.PresentationApplicationFactory.AttachOrCreateNew(PresentationArguments arguments, IPowerPointInstanceManager appInstanceManager)
— End of inner exception stack trace —
at UiPath.Presentations.PresentationApplicationFactory.AttachOrCreateNew(PresentationArguments arguments, IPowerPointInstanceManager appInstanceManager)
at UiPath.Presentations.PresentationApplicationFactory.Create(Boolean attachOnly)
at UiPath.Presentations.Activities.PresentationQuickHandle.SafeGetPresentation(Boolean attachOnly)
at UiPath.Presentations.Activities.PowerPointApplicationScope.Execute(NativeActivityContext context)
at System.Activities.NativeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

Hi,

It seems to be a problem of UsePowerpoint Presentation activity, not Add Image/Video to slide activity.
Can you check whether error occurs without Add Image/Video to slide activity?

Regards,

Hi,
Yes,you are right.Though I disable the "Add Image/Video to slide "activity,it throws teh same exception.

@maxzz - Please check this post and Download the xaml. Where I have added image to a PPT.

I have added the xaml here: Advent_Regex.zip (715.2 KB)

Hope this helps.

Hi,

Thank you for checking.
For now, can you try to run Repair tool for Office Interop in tool menu as the following image?

Regards,

1 Like

@maxzz - As @Yoichi mentioned, this errors seems to be related to powerpoint…check the message above…

1 Like

Hi,
I tried ,but it also throw the exception,maybe is my office ‘s(2016) problem.

Hi,
Maybe,you are right.


Checking interop registry entries…

Generating script for PowerPoint Interop repair actions <<<

Searching under
Error:
UiPath.Integration.OfficeExtensions.OfficeRepair.RepairActionException: Cannot find interop typelib registry entries. Please re-install Microsoft PowerPoint.
在 UiPath.Integration.OfficeExtensions.OfficeRepair.OfficeRepairActions.TwoStepInteropRepair.GetTypeLibRegPaths(IRepairActionExecutor actionExecutor)
在 UiPath.Integration.OfficeExtensions.OfficeRepair.OfficeRepairActions.TwoStepInteropRepair.RepairTypeLibRegistryEntries(IRepairActionExecutor actionExecutor)
在 UiPath.Integration.OfficeExtensions.OfficeRepair.OfficeRepairActions.RepairOfficeInteropAction.ExecuteForExecutor(IRepairActionExecutor actionExecutor)
在 UiPath.Integration.OfficeExtensions.OfficeRepair.OfficeRepairWindow.b__17_0(RepairOfficeInteropAction action)
在 UiPath.Integration.OfficeExtensions.OfficeRepair.OfficeRepairWindow.TryExecuteAction(OfficeAppInfo officeAppInfo, Action`1 action, Boolean resetActionButtons)

I will reinstall,thank you.

1 Like

Hi,thanks.I will reinstall the Office.

Thank you guys,after reinstall,it is okto run

1 Like

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