Bekijk de onderstaande video om te zien hoe je onze site als een web app op je startscherm installeert.
Opmerking: Deze functie is mogelijk niet beschikbaar in sommige browsers.
[SIZE=1]Option Explicit
Public Sub CountryVatNameAddress()
Dim strCountryCode As String
Dim strEnvelope As String
Dim strResponseText As String
Dim strVATNo As String
strCountryCode = "LU"
strVATNo = "26375245"
strEnvelope = "<soapenv:Envelope xmlns:soapenv=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:urn=""urn:ec.europa.eu:taxud:vies:services:checkVat:types"">"
strEnvelope = strEnvelope & "<soapenv:Header/>"
strEnvelope = strEnvelope & "<soapenv:Body>"
strEnvelope = strEnvelope & "<urn:checkVat>"
strEnvelope = strEnvelope & "<urn:countryCode>" & strCountryCode & "</urn:countryCode>"
strEnvelope = strEnvelope & "<urn:vatNumber>" & strVATNo & "</urn:vatNumber>"
strEnvelope = strEnvelope & "</urn:checkVat>"
strEnvelope = strEnvelope & "</soapenv:Body>"
strEnvelope = strEnvelope & "</soapenv:Envelope>"
With CreateObject("MSXML2.ServerXMLHTTP")
.Open "POST", "http://ec.europa.eu/taxation_customs/vies/services/checkVatService", False 'am_2016
.Send strEnvelope
strResponseText = .ResponseText
With CreateObject("MSXML2.DOMDocument")
.LoadXML strResponseText
If .getElementsByTagName("valid")(0).Text = "true" Then
MsgBox "Name : " & (.getElementsByTagName("name")(0).Text) & vbCrLf & "Address: " & .getElementsByTagName("address")(0).Text
Else
MsgBox "Invalid VAT number"
End If
End With
End With
End Sub[/SIZE]
We gebruiken essentiële cookies om deze site te laten werken, en optionele cookies om de ervaring te verbeteren.