troubleshooting Question

Access Compile Error Type Mismatch

Avatar of shieldsco
shieldscoFlag for United States of America asked on
Microsoft Access
14 Comments3 Solutions138 ViewsLast Modified:
I'm using the code below and get a type mismatch compile error on :
"(C:\Program Files (x86)\Microsoft Office\Office16\Excel.exe)"





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 CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 3 Answers and 14 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 14 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros