• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 945
  • Last Modified:

vb6 Open File For Output doesn't work in Vista

In Visual Basic 6.0, I have written a subroutine that creates a new text file using the command "open [file name] for output  as [#FileNumber]", then writes data to the file using the "Print" command.

This works in all versions of windows except Vista, where it simply does not create the text file, without any error messages.

Thanks for your help!
  • 2
1 Solution
What is the path of the file?
The program may not have write privileges where you are trying to write to.

Are you sure  you are not getting an error and just supressing it in VB?
Also what flavor is Vista ?
ttobin333Author Commented:
For file path, I tried application path and c:\. Which path would be safest to use?

Vista flavor is Home Premium.
ttobin333Author Commented:
I experimented with file locations and in the end created a new folder off of C:\, where I targeted the output file. It worked. I should have guessed that Vista didn't like me tampering with the program files folder and root directory...but XP didn't mind at all!


Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now