[Last Call] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1187
  • Last Modified:

msinet.ocx 429 error


I want to do an ftp from within Excel.
I have selected 'Microsoft Internet Transfer Control 6.0 (SP4)'
under Tools->References.

Below is the code.  I get stuck on the line
'Set ftp = New Inet' with error message...

Runtime error '429'
Acitvex component can't create object

Please help,
Function UploadFile(ByVal HostName As String, _
    ByVal UserName As String, _
    ByVal Password As String, _
    ByVal LocalFileName As String, _
    ByVal RemoteFileName As String) As Boolean
    Dim ftp As Inet
    Set ftp = New Inet
    With ftp
        .Protocol = icFTP
        .RemoteHost = HostName
        .UserName = UserName
        .Password = Password
        .Execute .URL, "Put " + LocalFileName + " " + RemoteFileName
        Do While .StillExecuting
        UploadFile = (.ResponseCode = 0)
    End With
    Set ftp = Nothing
End Function
  • 2
1 Solution
Are you properly licensed to use that control on your machine?  I believe you must have VB6 installed to use this control in the development environment.
bezalelyAuthor Commented:
I don't have VB6 installed on my computer, but the file was already present on my PC.
In that case is there any other way to FTP using Excel's VBA???
There are a lot of FTP components out there for use in VB / VBA and the prices vary.  

There are also some free examples of how to use the Windows API within your program to do simple FTP transfers.  Here are a couple of free code listings so that you can make your own FTP class module in VBA.  I have not personally used them so I can't say how well they work - but they are free.

FTP Class based on the FileSystemObject using the Wininet Library

Put basic FTP functionality in your VB applications

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now