excel vba add reference programmatically

The solution for “excel vba add reference programmatically” can be found here. The following code will assist you in solving the problem.

Sub Add_Reference()
Application.VBE.ActiveVBProject.References.AddFromFile _
“C:\Windows\System32\scrrun.dll”
End Sub

Sub Remove_Reference()
Dim oReference As Object
Set oReference = Application.VBE.ActiveVBProject.References.Item(“Scripting”)
Application.VBE.ActiveVBProject.References.Remove oReference
End Sub

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

Similar Posts