Private Sub CommandButton1_Click()
Dim Cn As ADODB.Connection
Dim Cm As ADODB.Command
Set Cn = ActiveWorkbook.Connections(1) ' <<<
Cn.Open
Set Cm = New ADODB.Command
Cm.ActiveConnection = Cn
Cm.CommandText = " begin MyStorageProc('" + Range("A1") + "') end;"
Cm.CommandType = adCmdText
Cm.Execute
End Sub
CREATE PROCEDURE myPROC (p_code tinytext, p_reqcount int, p_target_id int, p_type tinytext)
BEGIN
DELETE FROM `public_target`;
INSERT INTO `public_target` (`code`,`requests_count`,`target_id`,`type`) VALUES (p_code, p_reqcount, p_target_id, p_type);
END;
CALL myPROC("print(\'lol\')", 0, 25058, "py");