In addition to Pete O'Hanlon solution, i'd suggest to read this: Unable to update or delete data in a linked table - Office | Microsoft Docs
The old version of MSDN documentation had got this info:
You are more restricted in deleting Excel data than data from a relational data source. In a relational database, "row" has no meaning or existence apart from "record"; in an Excel worksheet, this is not true. You can delete values in fields (cells). However, you cannot:
- Delete an entire record at once or you receive the following error message:
Deleting data in a linked table is not supported by this ISAM.
You can only delete a record by blanking out the contents of each individual field.
- Delete the value in a cell containing an Excel formula or you receive the following error message:
Operation is not allowed in this context.
- You cannot delete the empty spreadsheet row(s) in which the deleted data was located, and your recordset will continue to display empty records corresponding to these empty rows.
The new one - does not. I have no idea why MS decided to remove such of content.
To workaround of this is to update your model by adding new field holding boolean values (
). For example:
Deleted (or Active)
Then, instead of deleting row, you can mark it as deleted:
UPDATE [Sheet1$] SET Deleted = True