Microsoft
Software
Hardware
Network
Question : Merge 2 text files - access denied?
Can someone show me a way to merge 2 text files into 1 or into a new text file?
I have a way but get "access denied" when trying to rename one of the files after the merge with FSO.
Dim fso As Object
Dim f, f2, File As Object
Set fso = CreateObject("Scripting.Fi
leSystemOb
ject")
Set f = fso.OpenTextFile("C:\Progr
am Files\Helios11\Credit Card Approved 7-15-10.txt", 1)
Set f2 = fso.OpenTextFile("C:\Progr
am Files\Helios11\Checking Approved 7-15-10.txt", 8)
f2.Write f.ReadAll
fso.MoveFile "C:\Program Files\Helios11\Checking Approved 7-15-10.txt", "C:\Program Files\Helios11\newname.txt
"
Kill ("C:\Program Files\Helios11\Credit Card Approved 7-15-10.txt")
Set fso = Nothing
Set f = Nothing
Set f2 = Nothing
Set File = Nothing
TIA,
Andrew
Answer : Merge 2 text files - access denied?
You may need to close the TextStreams before you can move the file.
f.Close
f2.Close
fso.Mo
veFile "C:\Program Files\Helios11\Checking Approved 7-15-10.txt", "C:\Program Files\Helios11\newname.txt
"
Random Solutions
Problem with Microsoft Transporter Suite
How can I copy a range of cells in a worksheet to another area in the same worksheet based off of the value of a cell in Excel 2007?
Exchange 2010 OWA Problem accessing Options
Microsoft Information Store stalling issues
Exhange 2003 mailbox permissions
Adding timestamp to outfile File
Return a Char at position
Access 2007, form datasheet view, change display property of an element based on another element in the record
Question about little code snippet
AJAX Refresh on Submit of Pop Up Window