Sub RemoveReferences()
'try to Remove a reference to Excel
On Error GoTo CanNotRemoveExcel
Application.VBE.ActiveVBProject.References.Remove "(C:\Program Files (x86)\Microsoft Office\Office16\Excel.exe)"
Exit Sub
CanNotRemoveExcel:
MsgBox "Can not reference Excel"
End Sub
ASKER
ASKER
ASKER
ASKER
compile error can't find project or libraryWhat version of Access? I'm using 2016, and the code runs as expected. I added an Excel reference, modified the path so it pointed to the correct location on my machine, and ran my code. I worked as expected, with no errors, and removed the reference.
ASKER
ASKER
ASKER
Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.
TRUSTED BY
That said - removing a reference via code can cause all sorts of issues. What exactly are you trying to do?