Deleting an Excel cell

  • Thread starter Thread starter timothym
  • Start date Start date
T

timothym

Hi, I am writing a project in .NET which needs to update some cells.
Now, these cells contain a function and the spreadsheet is linked. So,
since you cannot update a cell which contains a function, I tried to
delete it first (with the idea of updating later). But it does not even
allow me to delete with the following statement:

cmd.CommandText = "DELETE [Births$C24:C24] FROM [Births$]"
cmd.ExecuteNonQuery()

which should do the deletion if it works. But it is giving me an error
on the cmd.ExecuteNonQuery() (i.e. when the actual delete SHOULD occur)
telling me the following:

"Deleting data in a linked table is not supported by this ISAM"

The spreadsheet is in Excel 2000 format and it allows me to manually
delete a cell so I do not really understand if I can do the updating I
originally intended to do. I would appreciate any help!

Thanks and best regards,
Timothy
 
"Deleting data in a linked table is not supported by this ISAM"

In other words, this database operation is not supported by your database
middleware. There would be too many issues surrounding a delete row
operation. So the authors of the driver omitted it from their
implementation.
 
Thanks! But what I mean is not physically deleting a cell or row, bu
deleting THE CONTENTS of the cell. i.e. the same as if you go to th
cell, say, C25 and press DEL, which will empty the contents of tha
cell but it will still remain there physically.

Timoth
 
Thanks! But what I mean is not physically deleting a cell or row, but
deleting THE CONTENTS of the cell. i.e. the same as if you go to the
cell, say, C25 and press DEL, which will empty the contents of that
cell but it will still remain there physically.

That's the dilemma that the authors were facing. A database delete removes
a record from a table as opposed to setting each column to null and leaving
the record. In order the maintain spreadsheet integrity, the author of the
driver would have to emulate Excel in every aspect of a row delete, that
is, shifting data up, recomputing all relative cell addresses,
recalculating results etc. This logic is fairly complex and would take a
lot of time to write and debug. In addition, if would make the driver very
large, so he chose to omit it if from the drivers functionality.
 
Back
Top