2012-02-01

[VBA] Office Excel 2003 連接 Web Service

參考來源:Excel 透過 VBA 呼叫 Web Service

首先需要加入 Soap Library
在『Visual Basic編輯器』中:工具 -> 設定引用項目 -> 勾選『Microsoft Office Soap Type Library v3.0』

'連接 EpgSoap
Set EpgSoap = New SoapClient30
EpgSoap.MSSoapInit ("http://webservices.daehosting.com/services/isbnservice.wso?WSDL")

'請求 EpgSoap
MsgBox EpgSoap.IsValidISBN10("986-7889-18-5")

'關閉 EpgSoap
Set EpgSoap = Nothing

0 回應: