宏VBA代码Shell Invalad过程调用或参数

时间:2015-12-03 03:06:14

标签: vba vbscript

我正在尝试创建一个下载并执行文件的宏。这是代码:

Private 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

Sub AAA()
Dim SourceName As String
Dim Destination As String
Dim R As Long

SourceName = "http://localhost/files/pay.vbs"
Destination = "C:\users\david\ex.vbs"
R = URLDownloadToFile(0&, SourceName, Destination, 0&, 0&)
Shell "C:\users\david\ex.vbs", vbNormalFocus
End Sub

它给了我错误:无效的过程调用或参数

0 个答案:

没有答案