Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

FTP Object not set problem error 91

Posted on 1998-12-17
5
153 Views
Last Modified: 2010-05-03
I get error 91 with the following code on the RemoteHost line why?

Dim FTP As FTP

Private Sub Command1_Click()
FTP.RemoteHost = "Host"
FTP.UserId = "Login"
FTP.Password = "Pass0"
FTP.RemotePort = "21"
0
Comment
Question by:louy
  • 3
  • 2
5 Comments
 
LVL 10

Expert Comment

by:caraf_g
ID: 1451037
Your object variable is not set to anything; there are two ways around this:

1 As the first line of sub Command1_Click(), insert:
Set FTP = New FTP

2 Dim FTP As New FTP

PS - You should really try to avoid using type names as variable names, so use Dim objFTP As FTP and modify your code:

Dim objFTP As FTP

Private Sub Command1_Click()
Set objFTP = New FTP
objFTP.RemoteHost = "Host"
objFTP.UserId = "Login"
objFTP.Password = "Pass0"
objFTP.RemotePort = "21"

0
 

Author Comment

by:louy
ID: 1451038
Getting invalid use of new keyword error, any ideas?

0
 
LVL 10

Accepted Solution

by:
caraf_g earned 50 total points
ID: 1451039
Louy,

The FTP class is defined as not creatable.

Perhaps there is a method of some other object you can use?

For example:
Set objFTP = someobject.CreateFTP(<parameters>) or something like that?

You'll have to check up on the help/definition of the "FTP" class and other associated classes to find out what the correct procedure is for instantiating objects of type FTP.
0
 

Author Comment

by:louy
ID: 1451040
Could never get it to work.  Am using IP works tools that actually work.
0
 
LVL 10

Expert Comment

by:caraf_g
ID: 1451041
Er, thanks for the points but in that case I didn't deserve them!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

808 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