View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Boss Spearman Boss Spearman is offline
external usenet poster
 
Posts: 1
Default Delete Table from Excel

I'm trying to delete an access table from Excel.
When I try and delete the table using VBA this message appears:
"Cannot delete this index or table. It is either the current index or
is used in a relationship."
But there is no relationship with this table.
I can delete the table in access with no problem but I need to do it in
VBA.

I have tried to delete the tables by using these two methods.

strSQL = "DROP TABLE tblPrices;"
cnnX.Execute strSQL

vtSql = "DROP TABLE tblPrices"
cmd.CommandText = vtSql
cmd.Execute

Thanks