In Feburary 2016 05,
Open Microsoft Excel.
Click 'Tools,' 'Macro' and then 'Visual Basic.' This will open the VBA programming environment.
Click 'Tools' and 'Reference.' Scroll down and select the 'Microsoft Internet Transfer Control' and click 'OK.'
Click 'Insert' and 'Module.' You are now in a programming code module.Type or copy and paste the following in the code module:Function UploadFile(ByVal HostName As String, _
ByVal UserName As String, _ByVal Password As String, _ByVal LocalFileName As String, _ByVal RemoteFileName As String) As BooleanDim FTP As InetSet FTP = New InetWith FTP.Protocol = icFTP.RemoteHost = HostName.UserName = UserName.Password = Password.Execute .URL, 'Put ' + LocalFileName + ' ' + RemoteFileNameDo While .StillExecutingDoEventsLoopUploadFile = (.ResponseCode = 0)End WithSet FTP = Nothing
End Function
In Feburary 2016 05,
No comments:
Post a Comment