I'm getting the error "Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another" while trying to call a SQL Server stored procedure from Excel/VBA.
Can't figure out how to call from VBA?
Stored Procedure Parameters
CREATE PROCEDURE [dbo].[sp_Productivity_GetIndividuals] (
@startDate DATE,
@endDate DATE)
....
VBA Code
Dim rs As New ADODB.Recordset
Dim cmd As New ADODB.Command
With cmd
.ActiveConnection = con
.CommandText = "sp_Productivity_GetIndividuals"
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter("@startDate", adDate, adParamInput, , "3/1/2014")
.Parameters.Append .CreateParameter("@endDate", adDate, adParamInput, , "3/31/2014")
Set rs.ActiveConnection = .Execute
End With