続いてダウンロードも。

ついでにWEBサーバ上のファイルをダウンロード。

こちらのコーディングもVBAです。

 

 

'// 標準モジュールに張り付ける
'URLDownloadToFile API from URLMON.
Public Declare Function URLDownloadToFile Lib "urlmon" Alias _
"URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal _
szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long

'// 実際の処理
Const strURL = "http://hogehoge.com/test.xls"
Dim strFNAME As String  'ダウンロード先(パス+ファイル名)
Dim returnValue

'ファイル名をブックのパス+test.pdfとする
strFNAME = CurrentProject.Path & "\test.xls"

'URLDownloadToFile API をコールする
returnValue = URLDownloadToFile(0, strURL, strFNAME, 0, 0)

'結果の表示
MsgBox "結果は:" & returnValue
MsgBox strFNAME & "に保存されました"
こっちは簡単だね。
もちづき