msinet.ocx 429 error

Posted on 2005-04-10
Last Modified: 2012-06-27

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
Question by:bezalely
    LVL 32

    Accepted 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.

    Author Comment

    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???
    LVL 32

    Expert Comment

    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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
    Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now