Removing links to spreadsheet

  • Thread starter Thread starter DubboPete
  • Start date Start date
D

DubboPete

Hi all,

I am trying to code in the deletion or removal of a link to XLS
spreadsheet.

I have tried Docmd.SelectObject, but it doesn't recognise the object
when I then try to code in the delete stage.

Same result when trying Docmd.DeleteObject...

I even tried

DoCmd.SelectObject acTable, "TblRAW_CASTLEREAGH", True
CommandBars("Menu Bar"). _
Controls("Edit"). _
Controls("DeleteObject").accDoDefaultAction

It selects the xls spreadsheet, but won't remove/delete it!

Anyone able to help with some code to remove the link to the
spreasheet?

TIA

DubboPete
 
Hi Pete

Try this:
    CurrentDb.TableDefs.Delete "TblRAW_CASTLEREAGH"
--
Good Luck  :-)

Graham Mandeno [Access MVP]
Auckland, New Zealand




I am trying to code in the deletion or removal of a link to XLS
spreadsheet.
I have tried Docmd.SelectObject, but it doesn't recognise the object
when I then try to code in the delete stage.
Same result when trying Docmd.DeleteObject...
I even tried
DoCmd.SelectObject acTable, "TblRAW_CASTLEREAGH", True
CommandBars("Menu Bar"). _
       Controls("Edit"). _
       Controls("DeleteObject").accDoDefaultAction
It selects the xls spreadsheet, but won't remove/delete it!
Anyone able to help with some code to remove the link to the
spreasheet?

DubboPete- Hide quoted text -

- Show quoted text -

That worked great, thanks Graham
Will be using the routine on eight spreadsheets at least ten times a
day, so saves a lot of manual labour!

Pete
 
Back
Top