Both Write Range activities will overwrite what’s there, assuming you’ve given it the proper starting range (ie A1). You shouldn’t have the Excel file open when either of these are running.
Instead of using the classic activities use the modern activities of excel. Go to Activities panle → Click on filter symbol → Enable the modern.
Then the modern activities will appear in the activities panel. Now, take the use Excel file activity and pass the excel file path, inside use Excel file activity insert the clear sheet activity to clear the data in the sheet.
After that use the write datatable to excel activity to write the datatable to the excel sheet.