Allumer une position
Prérequis:
- Activer le mode développeur dans Excel
- Créer une Macro
- Déposer le code ci-dessous
Private Sub Button_Click()
Position = Application.ActiveSheet.Cells(ActiveCell.Row, ActiveCell.Column).Value
ServerAddress = "xx.pblsrv.com"
User = "admin"
Password = "yourpassword"
Url = "http://" & ServerAddress & ":1337/PBL_SwitchOnPosition/.json?Position=" & Position
Set objHTTP = CreateObject("MSXML2.ServerXMLHTTP")
objHTTP.Open "POST", Url, False, User, Password
objHTTP.send ("{""key"":null,""attachments"":null}")
MsgBox objHTTP.responseText
End Sub
Eteindre une position
Private Sub Button_Click()
Position = Application.ActiveSheet.Cells(ActiveCell.Row, ActiveCell.Column).Value
ServerAddress = "xx.pblsrv.com"
User = "admin"
Password = "yourpassword"
Url = "http://" & ServerAddress & ":1337/PBL_SwitchOffPosition/.json?Position=" & Position
Set objHTTP = CreateObject("MSXML2.ServerXMLHTTP")
objHTTP.Open "POST", Url, False, User, Password
objHTTP.send ("{""key"":null,""attachments"":null}")
MsgBox objHTTP.responseText
End Sub