Link to home
Start Free TrialLog in
Avatar of HyperBPP
HyperBPP

asked on

DELETE in Excel as Datasource VB.net OR workaround

I'm using Excel 2013 as a datasoure.  I am unable to perform DELETE commands on rows when using as a datasource.  I am using the following provider for my ADODB: Provider=Microsoft.ACE.OLEDB.12.0

Is there a way to perform a delete or an elegant workaround?   Can I perform a SELECT statement and get the specific row of a record?  If so I could delete the row via VB.net.  Would prefer this to having to search through the table for a matching record.
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

>>I'm using Excel 2013 as a datasoure.

As that is NOT a database then your problem makes sense.
For solutions consider automating Excel (not via ADODB) or changing the datasource to a database (eg. Access or SQL Server) or just overwriting the contents of that row should that be acceptable.
Avatar of HyperBPP
HyperBPP

ASKER

Is there a way to identify the target row without having to loop through every record?  Like is there a recordset select statement that can say which row number a record came from?

I'm not certain I understand what you mean by "Automating Excel"?  Is this embedded macro or the idea of directly accessing cells?  If the latter I still have the undesirable loop through every record.
ASKER CERTIFIED SOLUTION
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial