How to set properties inside Write Cell (Workbook activity)

Hi Experts,

I want to update a column in an Excel with a formula and fill each of its cell with the formula result. In order to fill each cell with the value, I use For Each Row and Write Cell activity. However, I got some issues while setting the properties of Write Cell activity as below image (mostly about data type):

  1. Issue 1

  2. Issue 2

Please advice.

Thank you.

Hi @D_Okthree

In write cell

Excel.Sheet(“Sheet1”).Cell(“C1”)

Hello D_Okthree,

What to write : You are writing as integer, convert your Integer to string
Where to Write : Excel.Sheet(SheetName).Cell(CellValue)

HI @D_Okthree

Try like this

Regards
Gokul

Hi @D_Okthree

In what to write property, you can only able to pass the string variables. So add .tostring after the code you have written(if the code returns any type like integer, double etc then it converts to string).
In Where to write, give like this: Excel.Sheet("Sheet1").Cell("C1") Then it writes the value in particular cell c1

Note: Don’t forget to check the auto increment row increment the cell value for each iteration.

Hello @D_Okthree

For Each Row in ExcelDataTable

Assign activity: Formula = "=Sheet1!A" + row.Index.ToString + "*2"
Write Cell activity: SheetName = "Sheet1", Cell = "B" + row.Index.ToString, Value = Formula

Thanks & Cheers!!!

@Dilip_Wakdikar_1996 ,

Why this is not working in “What to write”?

I also have tried using Convert.ToString() function yet it is not working either.

@D_Okthree

you need to write it as

CurrentRow(1).tostring

please change it and try again

cheers

@Shiva_Nikhil ,

It is not working.

@D_Okthree

can you try by deleting the activity and replacing it with the new write cell and try

if you facing again the same issue

please send the screenshot of the writecell activity which you are using

cheers

@lrtetala ,

It is not working under "What to write’.

Hi @D_Okthree
You are using write cell activity so try this
Excel.Sheet(“Sheet1”).Cell(“C2”)

Follow below steps:

  1. Click on Add button

  2. Select Excel and then custom input

  3. Provide your details here
    image

Hi @D_Okthree you are using write cell and in that field you write Excel.Sheet("Sheet1).Range(“C2”), you use range that’s why you are getting error, replace range with cell as follows:

Excel.Sheet(“Sheet1”).Cell(“C2”)