Solved

open file Error

Posted on 1998-06-11
1
156 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
1 Comment
 
LVL 4

Accepted Solution

by:
yowkee earned 100 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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 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…

856 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