Search code examples
ms-access

How can I remove a link to an excel document from a previous 'DoCmd.TransferSpreadsheet acLink ..' command?


In MS Access I made a link to an excel workbook, via VBA, with the following command:

DoCmd.TransferSpreadsheet acLink, acSpreadsheetTypeExcel12Xml, "link", "C:\Users\mike\Desktop\bim2024.xlsx", True, "Sheet1$"

Now I need to remove that link via another command in VBA but I don't know how to do it.

I tried with .remove but it didn't work


Solution

  • DoCmd.DeleteObject acTable, "YourLinkedTableName" will get you there.