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

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

msinet.ocx 429 error

Hi,

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,
Oren
*************************************
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
            DoEvents
        Loop
        UploadFile = (.ResponseCode = 0)
    End With
    Set ftp = Nothing
End Function
*************************************
0
bezalely
Asked:
bezalely
  • 2
1 Solution
 
Erick37Commented:
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.
0
 
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???
0
 
Erick37Commented:
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
http://www.paradoxes.info/code/FTPClass.html

Put basic FTP functionality in your VB applications
http://builder.com.com/5100-6373-1045308.html
0

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