Unable to click button or pass hotkey

excel
uiautomation
sap

#1

Hello,

I am trying to pass data from webpage to Excel. While doing so Excel throws one popUp box ‘Repairs to Excel file’ containing message such as Excel was able to open the file by repairing or removing the unreadable content and then close button appears.

All I have to do is to close that button and then Save content in different file. But I am not able to automate so. While clicking Close button or passing hotkey ‘Enter’. Error comes such as – unable to cast object of type ‘newtonsoft.json.linq.jobject’ to type ‘system.string’.

Please see this pic, I want to automate to press the close button.

Error is coming, while doing so.


#2

Can you attach your code? Looks like a parsing issue.


#3

Hello.

You are trying to copy a Json object, “to paste it” as string in excel you need to deserialize first.

regards.


#4

Hello, I cant share entire code. but here is a small example.Main.xaml (17.6 KB)

Here I am automating it. Because this kind of Excel file I am not able to use directly.

As a work-around I have clicked save image and then saving this file with different name. Then I am able to do computation on that file. But I would like if you would solve my issue. so I dont have to do save n all…


#5

@Chand

  1. Are you using CITRIX ?

  2. you said “I am trying to pass data from webpage to Excel. While doing so Excel throws one popUp box ‘Repairs to Excel file’ containing message such as Excel was able to open the file by repairing or removing the unreadable content and then close button appears.”

Can you send this code? If possible data.


#6

No not citrix automaiton. I click on button Export to Excel. Then Excel file gets downloaded but when I open that Excel file it asks me Repairs to… I have to click on close button otherwise it wont let me go ahead.


#7

< wnd app=‘excel.exe’ cls=‘bosa_sdm_XL9’ title=‘Repairs to ‘ListofBusinessMessages__EN.xlsx’’ />
Check your selector.
there must be some invalid characters in the selector. Use a wildcard * to remove them.