Is it posssible (i think it should) to open multiple files, i keep getting a file already open warning even though i have give different file id for each file, CAN ANYONE HELP?
Many Thanks
Printable View
Is it posssible (i think it should) to open multiple files, i keep getting a file already open warning even though i have give different file id for each file, CAN ANYONE HELP?
Many Thanks
Of course it is possible to have multiple files open. I have done it many times myself. I take it you are using the FreeFile function to return a file number.
The error sounds like another program is using the file, or that you have opened it before and not closed it.
Good luck.
ExecCmd ("cmd /c ""dir e:\netvespaweb >e:\Centra~1\Cabini~1\DirectoryFolder.txt /s /b /a:d""")
'Create a file with file listings
ExecCmd ("cmd /c ""dir e:\netvespaweb >e:\Centra~1\Cabini~1\FileFolder.txt /s /b """)
Open "e:\Centra~1\Cabini~1\DirectoryFolder.txt for Output as #2
Open szNameCabIni For Input As nCabIniID
Why do i get the error when freefile is used for th nCabIniID?
Many Thanks
What i want to do is open a file, open another, then write contents of one file to another file so i would like both files open.
"As anybody got a clue, what to do..." BLOCK BUSTER...!!!
D'oh..!!
As Iain said use Freefile to locate next free filenumber. You should use this number in all operation with that file so store them in variables as follows:
Code:Dim ff1 as integer, ff2 as integer
ff1 = freefile
open file1 as input as ff1
ff2 = freefile
open file1 as input as ff2