2012-02-01 15:18

[VBA] Office Excel 2003 連接 Web Service

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

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

  1. '連接 EpgSoap 
  2. Set EpgSoap = New SoapClient30 
  3. EpgSoap.MSSoapInit ("http://webservices.daehosting.com/services/isbnservice.wso?WSDL") 
  4.  
  5. '請求 EpgSoap 
  6. MsgBox EpgSoap.IsValidISBN10("986-7889-18-5") 
  7.  
  8. '關閉 EpgSoap 
  9. Set EpgSoap = Nothing 

0 回應: