S
Scott
I'm trying to remove a reference in my function "RemoveReference" below.
CODE 1 works if I hard-code the reference "Calendar" that I'm trying to
remove. My problem is in CODE 2. If I try to pass the reference to the
function I get a "Subscript Out Of Range" error.
Can someone help me with my syntax in CODE 2?
USAGE ***********
call RemoveReference("Calendar")
CODE 1 **********
Function RemoveReference(sLibrary As String)
Dim ref As Reference
Set ref = References![Calendar]
References.Remove ref
End Function
CODE 2 **********
Function RemoveReference(sLibrary As String)
Dim ref As Reference
Set ref = References!sLibrary
References.Remove ref
End Function
CODE 1 works if I hard-code the reference "Calendar" that I'm trying to
remove. My problem is in CODE 2. If I try to pass the reference to the
function I get a "Subscript Out Of Range" error.
Can someone help me with my syntax in CODE 2?
USAGE ***********
call RemoveReference("Calendar")
CODE 1 **********
Function RemoveReference(sLibrary As String)
Dim ref As Reference
Set ref = References![Calendar]
References.Remove ref
End Function
CODE 2 **********
Function RemoveReference(sLibrary As String)
Dim ref As Reference
Set ref = References!sLibrary
References.Remove ref
End Function