Error to Write Formula in Excel

I need to write an if formula in excel, but this is showing the error below:

RemoteException wrapping UiPath.Excel.ExcelException: The data you want to write, “= IF (N2 <= Q 1, Attention!, OK)”, is in the wrong format, or Excel is busy. If your data is a formula, be sure to use the comma as a parameter separator. Make sure that you are not editing a value and that dialog windows are not open. —> RemoteException wrapping System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x800A03EC
at System.RuntimeType.ForwardCallToInvokeMember (String memberName, BindingFlags flags, Object target, Int32 aWrapperTypes, MessageData & msgData)
at Microsoft.Office.Interop.Excel.Range.set_Value (Object RangeValueDataType, Object)
at UiPath.Excel.WorkbookApplication. <> c__DisplayClass75_1. b__1 ()
at UiPath.Excel.ExcelContextHelper.Execute (Action action, ExcelContext context, Object contextParams)
— End of inner exception stack trace —
at UiPath.Excel.Activities.ExcelInteropActivity`1.EndExecute (AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution (AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute (ActivityExecutor executor, BookmarkManager bookmarkManager)

The formula is:

“= IF (N2 <= Q 1,” + “Attention!” + “, OK)”

Hi @lourena.coutinho

Is Attention! a variable?

Hello, no, is a text.

Try this “= IF (N2 <= Q 1,Attention!, OK)” and also make sure excel is not opened when the process is running…

Is there additional space after Q??

30 / 5000

Resultados da tradução

I forgot that between I have these characters:
IF(N2<=$Q$1;“Atenção!”;“OK”)

@lourena.coutinho - Please check this…

image

In Excel…

image

Hope this helps…

Note: Since you have double quotes, you have to use ““Attention!”” like this , if not write cell will show an error.

2 Likes

Works, thank you! :slight_smile:

1 Like

Other Question. When the robot writes a formula in excel, the formula shows “#name ??” in the cell.

So I need to click on the cell, to show the correct result, is there any way to write the formula without having to click on the cell afterwards and the result appears correctly? My excel is in Portuguese (I don’t know if this is the reason).

@lourena.coutinho - Sorry not sure , what exactly happening with your excel…

Could you please try your formula manually in excel first and see you are getting the result…, if that works then you can use the same in Write cell activity.

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