Help with excel automation - updating excel cell with a information stores in a variable

Hello Wonderfull people,
I need your help if possible with this problem.
The context is:
i have to open an excel file. This excel file has several sheets. but in one of the sheet there is a cell (C2) where a date can be set to update all the excel file document information. In addition this excel cell is formated to date (C2).

But i have to use the yesterday information to update this excel file

To do that i built my UiPath program with three variables as shown in picture below

Then i create a Excel process scope to indicate where my excel file is located and to position my program in the correct Sheet (please check picture below)

And here is my where my problem starts:
I use again a excel process scope to use a Write cell activity to be able to write the date from yesterday which have been stored in my Date_name variable.
image

I have this message error:
image

Could you please help or give any solutions ideas to overcome this problem.

Thanks in advance
Richch

You don’t really have to do this:

image

You can just use those expressions throughout your automation wherever you need those values. The only case where you’d want to store them in variables at the beginning is if this automation would start on one day and finish on another. Also, there’s no reason to have these inside an Excel Process Scope.

You don’t use Clicks inside Use Excel file. Clicks are UI automation. Use Excel file is for the Excel activities to be used - like Read Range, Read Cell, Write Range, Write Cell, etc.

Your Write Cell needs to be inside the Use Excel.

1 Like

I suggest completing this and the other free training on their Academy web page. It covers these kind of basic things.

1 Like

@Ricchch
You need to put Range like this. Try this

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

1 Like

Hi @Ricchch

You can generate that too using indicate in excel , please refer screenshot

You can type directly too like mentioned above.

Thanks.

1 Like

Hello @prateek.mehandiratta9 and thanks for helping
I made your suggestion.
image

and i got this screen, where i press to confirm .
image

However, despite the cell has been selected correctly, i still have an error (please check picture below)

image

did i forget to make something in this procedure?
Thanks a lot,
Rich

Thank you for all your advices and responses guys.
All them where very important guides to continue learning about Uipaht. I am new on UiPath develops
:handshake:
Richch

Hey,

Even i am using the same and it gives no error:

Excel.Sheet(“TOC”).Cell(“A4”)

Can you drag n drop a new Write Cell activity and then try.

Thanks.

1 Like

You don’t have to click the cell before writing to it with Write Cell. You don’t use UI Automation (clicks etc) when working with Excel. Please do the free UiPath Academy training.

1 Like
  1. Did you try completely deleting the Write Cell activitiy and recreating it from scratch?
  2. Did you try opening the “Where to write” expression editor, doing Ctrl+A to select all the content, and post it here to check whether there’s some weird char in the expression?
  3. Did you try opening the “Where to write” expression editor to check whether for some reason there’s something weird on a different line that might be hidden on the inline field? For example:
1 Like

Thanks, its working now :clap: :handshake:

1 Like