RyanBank
asked on
error:User defined type not defined
Hi,
Please assist what could be missing, vb returns the error: User defined type not defined
pointing to the following line:
Private Function GetExcelConnection(ByVal Path As String, Optional ByVal Headers As Boolean = True) As Connection
Thanks.
Please assist what could be missing, vb returns the error: User defined type not defined
pointing to the following line:
Private Function GetExcelConnection(ByVal Path As String, Optional ByVal Headers As Boolean = True) As Connection
Thanks.
ASKER
bruintje,
here's the whole function with the connection type. what could be happening?
thanks.
Private Function GetExcelConnection(ByVal Path As String, Optional ByVal Headers As Boolean = True) As Connection
Dim strConn As String
Dim objConn As ADODB.Connection
Set objConn = New ADODB.Connection
strConn = "Provider=Microsoft.Jet.OL EDB.4.0;" & _
"Data Source=" & Path & ";" & _
"Extended Properties=""Excel 8.0;HDR=" & _
IIf(Headers, "Yes", "No") & """"
objConn.Open strConn
Set GetExcelConnection = objConn
End Function
here's the whole function with the connection type. what could be happening?
thanks.
Private Function GetExcelConnection(ByVal Path As String, Optional ByVal Headers As Boolean = True) As Connection
Dim strConn As String
Dim objConn As ADODB.Connection
Set objConn = New ADODB.Connection
strConn = "Provider=Microsoft.Jet.OL
"Data Source=" & Path & ";" & _
"Extended Properties=""Excel 8.0;HDR=" & _
IIf(Headers, "Yes", "No") & """"
objConn.Open strConn
Set GetExcelConnection = objConn
End Function
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
bruintje,
can you kindly assist, i'm out of luck on this one:
https://www.experts-exchange.com/questions/21920356/error-syntax-error-in-FROM-clause.html
thanks
can you kindly assist, i'm out of luck on this one:
https://www.experts-exchange.com/questions/21920356/error-syntax-error-in-FROM-clause.html
thanks
sorry i was out with the family, but i see your problem was already solved
----------
think its missing the reference to the connection type, the function returns a connection but where is Connection delcared?
----------
bruintje