kdjonesmtb2
Technical User
Receiving the following error:
Permission denied
Line (3617): "Set qfile = fspenTextFile("\\ikanas267\Documents\kgittensjones\My Documents\QTP 834\Text files\qtptest2.x12", ForAppending,True)".
Code:
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Set fso=createobject("Scripting.FileSystemObject")
Set qfile1 = fspenTextFile("\\ikanas267\Documents\kgittensjones\My Documents\QTP 834\Text files\qtptest2.x12", ForAppending,True)
qfile1.WriteLine("last line of text.")
What could be causing this and how can I get access?
I was able to create the file using the following code that is in the same script
Set fso=createobject("Scripting.FileSystemObject")
'Create a non existing file "qtptest.txt " with overwrite option as True
'Set qfile1=fso.CreateTextFile("\\ikanas267\Documents\kgittensjones\My Documents\QTP Test 834\Text files\qtptest1.txt",true,False) ' textname could become a variable so that many could be generated
'Set qfile1=fso.CreateTextFile("\\ikanas267\Documents\kgittensjones\My Documents\QTP Test 834\Text files\ X",true,False)
'Set qfile1=fso.CreateTextFile("\\ikanas267\Documents\kgittensjones\My Documents\QTP Test 834\Text files\ &(DataTable.Value("TxtFileName",dtGlobalSheet)",true,False)
Set qfile1=fso.CreateTextFile("\\ikanas267\Documents\kgittensjones\My Documents\QTP 834\Text files\" & TextFileName,true,False) 'TextFileName used as a variable so that multiple 834 files can be generated from DataTable
qfile1.Write((DataTable.Value("Interchange_Control_Header",dtGlobalSheet)))
qfile1.Write((DataTable.Value("Common_Delimiter",dtLocalSheet)))
qfile1.Write((DataTable.Value("ISA01_I01_Author_Info_Qualifier",dtGlobalSheet)))