Clipboard saving issue

studio

#1

Hey folks,

I am trying something that has been done by the community before. I am getting the cells from excel as image on the clipboard[no problem here], but I get this error while saving it. But, when I remove excel scope and just run the clipboard (which has the picture on it) and save, it does save whatever is on my clipboard. So confusing.


saveimage.xaml (21.1 KB)
book.xlsx (15.1 KB)


#2

HI @Joshikumarav,

i have modified few things in your code , now saving the image perfectly, refer this xaml file
saveimage (4).xaml (21.9 KB)

Regards,
Arivu


#3

Hey Man,

I still get the issue. If I try to directly save from the clipboard, it works just fine. Just beating myself on what is wrong here.

saveimage has thrown an exception

Source: Invoke method

Message: Save image failed. Check if the file name is a valid path

Exception Type: ImageOperationException

UiPath.Core.ImageOperationException: Save image failed. Check if the file name is a valid path —> System.NullReferenceException: Object reference not set to an instance of an object.
at UiPath.Core.Image.SaveFile(String fileName)
— End of inner exception stack trace —
at System.Activities.Statements.MethodExecutor.InvokeAndUnwrapExceptions(Func`3 func, Object targetInstance, Object[] actualParameters)
at System.Activities.Statements.MethodResolver.SyncMethodExecutor.BeginMakeMethodCall(AsyncCodeActivityContext context, Object target, AsyncCallback callback, Object state)
at System.Activities.Statements.MethodExecutor.BeginExecuteMethod(AsyncCodeActivityContext context, AsyncCallback callback, Object state)
at System.Activities.Statements.InvokeMethod.BeginExecute(AsyncCodeActivityContext context, AsyncCallback callback, Object state)
at System.Activities.AsyncCodeActivity.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)


#4

@ddpadil @ClaytonM guys any thoughts on this?

The fact that I can’t get around is, when I run the workflow first time, it throws me error (but the image is in the clipboard), now i remove the excel portion and just use clipboard.GetImage and Save image. It is indeed saving the image what was previously on the clipboard.

Any thoughts if this is a bug?


#5

Hi @Joshikumarav,
Refer my code it will work. I checked its working fine.

I removed after excel application scope you are again getting value from the clipboard, once you close the excel file your value will not be there in the clipboard so it will throw the error. So I just disconnected after excel application scope image save option.

Regards,
Arivu


#6

Hey Arivu,

That’s very strange. I downloaded your copy again and just ran. Its still throwing me the same error. What else could the issue be? Oh my goodness.


Thanks,
Joshi


#7

Hi @joshikumarav,

Can you check while running the excel file is coming front ??
Or running in background it self??

Regards,
Arivu


#8

Hi Arivu,

It does. It select and copies the cells having the excel in focus and brining up.

Thanks
Joshi


#9

HI @Joshikumarav,

refer this for me working fine
saveimage (4).xaml (19.1 KB)

can you try this one

Regards,
Arivu


#10

Tried it. Still the same thing!! Can we ask the product guys, if its a windows env issue? I am using windows 10.


#11

Oh ok @Joshikumarav,
Seletor May be differ.
I checked in the window 7, can you reselect the selector.

Regards,
Arivu


#12

But, i don’t get this part. The image does get copied to the clipboard. It runs normally when I re-run right after the issue (removing the excel application scope). The image saves perfectly. Confuses me why it behaves so?


#13

Hi any Solution to this issue ? I’m facing the same issue .