1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
Bonjour,
Voilà le code du module que j'ai rajouté et qui contient le code de ma fonction :
Sub Insert()
Dim objDBHelper As New DBHelper
Dim rs As ADODB.Recordset
Dim strSP As String
Dim params As Variant
Dim test1 As Variant
Dim test2 As Variant
On Error Resume Next
strSP = "sp_History"
params = Array(Array("@IDAct", adVarChar, 70, IDAc, adParamInput) _
, Array("@Date", adDate, 10, DateExe, adParamInput))
Set rs = objDBHelper.RunSPReturnRS(strSP, params)
If Not rs.EOF Then
Worksheets(gSheet3Name).Range("Heures") = rs.Fields("Quantity").Value
Worksheets(gSheet3Name).Range("NUO") = rs.Fields("Amount").Value
Worksheets(gSheet3Name).Range("Frais") = rs.Fields("PENAmount").Value
Worksheets(gSheet3Name).Range("Achat") = rs.Fields("CHAmount").Value
Worksheets(gSheet3Name).Range("HeuresA") = rs.Fields("QuantityA").Value
Worksheets(gSheet3Name).Range("NUOA") = rs.Fields("AmountA").Value
Worksheets(gSheet3Name).Range("FraisA") = rs.Fields("AmountA").Value
Worksheets(gSheet3Name).Range("AchatA") = rs.Fields("AmountA").Value
End If
rs.Close
Set rs = Nothing
End Sub |
Partager