View Single Post
  #2  
Old 03-21-2012, 02:29 PM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi djacoby,

Thanks for the question. First off, you don't need to get a new handle to the file system object for each file you want to use. You could use the following :
Code:
Set fso = CreateObject("Scripting.FileSystemObject")

Set objFile1 = fso.OpenTextFile("C:\Documents and Settings\jacobda\My Documents\Knology\Configs\RAPD\MRV\MRV Names.txt", ForReading, False)
Set objFile2 = fso.OpenTextFile("C:\Documents and Settings\jacobda\My Documents\Knology\Configs\RAPD\MRV\MRV IPs.txt", ForReading, False)
Set objFile3 = fso.OpenTextFile("C:\Documents and Settings\jacobda\My Documents\Knology\Configs\RAPD\MRV\" & name & ".txt", ForWriting, True)
The problem you are having writing a file seems to be the variable you are using to reference the file object handle. Here is your line of code:
Code:
file.Write readline & vbCrLf
I don't see in your code where you have defined the file object.

I suspect that you need to use the following:
Code:
file3.Write readline & vbCrLf
Another suggestion would be to follow every Send() with a WaitForString(). This is a best practice to avoid sending data before the remote device is ready to receive data.

Does this help to resolve the issue?
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote