"sub or function not defined" compile error in Excel macro

I am recieving the compile error of "sub or function not defined" when attempting to do an execution on a macro in Excel, however I do not understand why.

The debugger is listing this line of code as the problem:
"Function GetPossibleAnswers(ByVal iResponseGroupID As Integer, ByRef arAnswers() As Variant)"

Am I not able to pass by reference a variant array in this manner?

Here is the complete code:

Function NoNulls(vValue, bIsNumber)
'----------------------------------
'Purpose: Automatically convert null values to zero or empty string
' bIsNumber denotes if a 0 or an empty string should be used if null encountered
' otherwise returns non-null value
'---------------------------------
 If IsNull(vValue) Then
   If bIsNumber Then NoNulls = 0 Else NoNulls = ""
 Else
   NoNulls = vValue
 End If
End Function

Function GetPossibleAnswers(ByVal iResponseGroupID As Integer, ByRef arAnswers() As Variant)
  Const SQLCONNECTION As String = "Driver={SQL Server};Server=localhost;Database=QA;UID=SA;PWD="
  Dim strSP
  Dim rsAnswers As New ADODB.Recordset
  Dim objSQLDB As New ADODB.Connection
  Dim iCounter
  objSQLDB.Open SQLCONNECTION
  strSP = "spGetResponseGroupData " & iResponseGroupID
  rsAnswers.Open strSP, objSQLDB
  If Not rsAnswers.EOF Then
    iCounter = 0
    While Not rsAnswers.EOF
      arAnswers(i, 0) = NoNulls(rsQuestion("AnswerID"), 1)
      arAnswers(i, 1) = NoNulls(rsQuestion("Answer"), 0)
      arAnswers(i, 2) = NoNulls(rsQuestion("Explanation"), 0)
      arAnswers(i, 3) = NoNulls(rsQuestion("Scorable"), 1)
      rsAnswers.MoveNext
      iCounter = iCounter + 1
    Wend
    rsAnswers.Close
  End If
  Set rsAnswers = Nothing
  objSQLDB.Close
  Set objSQLDB = Nothing
End Function

Sub test()
 
  Dim arAnswers(10, 4) As Variant
  Call GetPossibleAnswers(3, arAnswers())
  For intI = 0 To UBound(arAnswers())
    MsgBox arAnswers(intI, 1)
  Next intI
End Sub
LVL 1
DivaqsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DivaqsAuthor Commented:
By the way, I did try
"Function GetPossibleAnswers(ByVal iResponseGroupID As Integer, ParamArray arAnswers() As Variant)"

And still receive the same error.
0
gakibbieCommented:
A few things:
1) You have rsQuestion in the GetPossibleAnswers Function
2) You have i in the GetPossibleAnswers Function
3) You have the a different variable name in your second GetPossibleAnswers function params in your second comment.

It looks like a case of mixed up variable names to me...
I hope this helps.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Office

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.