Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open For ? Access Read Write Lock Read Write

Status
Not open for further replies.

ajwilkins

Programmer
Dec 11, 2002
2
GB
I want to use Input # and Write # on the same file as part of a VB macro in Excel.
If I Open For Input then the Write # creates a bad file mode
If I open for anything other than Input then the Input # gets a bad file mode.
The VB help implies that read write access is possible but I just cannot fathom what the syntax can be.
So I am opening and closing the file for each access - a bit sucky.
I do not want to use Random access.
This is my first ever VB macro so be gentle and thanks if you can help.
 

Here are the two ways in VB...
[tt]
Open FileName For Random Access Read Write As #FileNumber
Open FileName For Binary Access Read Write As #FileNumber
[/tt]

Good Luck

 
thanks for that but I'd rather leave it as a text file.
I'll guess I'll just have to carry on with my clunky workaround
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top