?
Solved

open file Error

Posted on 1998-06-11
1
Medium Priority
?
166 Views
Last Modified: 2010-05-03
When i do the following , VB gave me a path not found message (highlighting line 2) Why ?
open "c:\windows\temp\file1.text" for Input as #1
open "c:\windows\temp\file2.text" for Input as #2
Data = "Myname"
Put #1 Data
0
Comment
Question by:kwl
[X]
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
1 Comment
 
LVL 4

Accepted Solution

by:
yowkee earned 200 total points
ID: 1463169
kwl,

  What it really means is the file "c:\windows\temp\file2.text" is not existed! Open statement will create file for non-existed file path *only* for Append, Binary, Output, or Random modes.

  Besides, it is better to use the FreeFile function to obtain the next available file number.

eg.  Dim iFile as Integer
     iFile = FreeFile
     Open "C:\temp\test.txt" for output As #iFile

Regards.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

719 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