Solved Remove linked excel from Access db

ImruDa

New member
Local time
Today, 18:51
Joined
May 5, 2020
Messages
9
Hello everyone!

I am using the below code to link my Access db to excel and name the linked excel as "Tabelle1". After using the data from excel I want to remove this link and make free Access from excel. How should I do it through VBA ? Thank you for help
Code:
 DoCmd.TransferSpreadsheet acLink, acSpreadsheetTypeExcel12Xml, "Tabelle1", "C:\Lotus\Newemp", False '<-- Sheet
    CurrentDb.TableDefs.Refresh
 
To delete a table you can use
Code:
CurrentDB.TableDefs("name").Delete
This would delete a "linked table"'s link just the same.
 

Users who are viewing this thread

Back
Top Bottom