Overwrite message in Excel

I am currently working with multiple activities with an excel application scope, usually I could run my program without any interruption, but now every time the bot performs an activity involving overwriting in other ranges excel shows me the message “There is already data here. Do you want to replace it?”, is there a way I can stop seeing this message again and continue to use my overwrite activities normally?

@JavXult

Maybe you need to do this steps below described in the link

Hope this will help you

Thanks

Already tried that! but I’m still getting the message, but for some strange reason as I mentioned before, this message didn’t used to appear and suddenly today it does.

Hi @JavXult.

It might be the case that the excel is grabbing junk data from any steps/Inputs you might be performing, try with delete range before writing the data on the specified range you want to write if that does not work, Use delete range and after that Try deleting those rows using CTRL+ - which you can pass through Vb script.

Thanks

The thing is that I am using the “Text to columns” option of excel and when selecting the column this is the one that will be replaced with the new values ​​so I cannot delete the current content because it is the one that I will use.

Like Shikhar indicated, using Excel Application Scope brings in what we call Excel Garbage so in reality, while you may not see anything, there is probably something there. There are several workarounds, but I consistently use this code to get rid of Garbage. First, (do all of this in the same excel app scope) read your data set as a dt, then use this in an assign replacing dtTest with your dt variable name

dtTest.Rows.Cast(Of DataRow)().Where(Function(row) Not row.ItemArray.All(Function(field) field Is DBNull.Value Or field.Equals(“”))).CopyToDataTable()

then do a delete range and check the box for ShiftUp

Then write the range dt variable name. This should get rid of all of the Excel Garbage

1 Like

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