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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to append a text file starting from the last populated row

Status
Not open for further replies.

kdjonesmtb2

Technical User
Nov 19, 2012
93
0
0
US
How do I add code to append the following text file from the last populated row?

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)))


I want to populate with the following values pulled from an excel file and loaded to the vbscribt variables below


File_Header_REF7 = Trim(objDriverSheet.Range("A"& intRow ))
REF01_Reference_Identification_Qualifier4 = Trim(objDriverSheet.Range("B"& intRow))
REF02_Reference_Identification5 =Trim(objDriverSheet.Range("C" & intRow))



Dim rowcount
Dim objexcel
Dim objWorkbook
Dim objDriverSheet
Dim intRow
Dim File_Header_REF7
Dim REF01_Reference_Identification_Qualifier4
Dim REF02_Reference_Identification5



set objexcel = Createobject("Excel.Application")
'xlApp.visible = true
Set objWorkbook = objexcel.WorkBooks.Open("M:\QTP 834\DataTable_Spillover.xls")
Set objDriverSheet = objWorkbook.Worksheets("Sheet1")
intRow = 2
For inttRow = 2 to objDriverSheet.UsedRange.Rows.Count
File_Header_REF7 = Trim(objDriverSheet.Range("A"& intRow ))
REF01_Reference_Identification_Qualifier4 = Trim(objDriverSheet.Range("B"& intRow))
REF02_Reference_Identification5 =Trim(objDriverSheet.Range("C" & intRow))


print "File_Header_REF7"
Print File_Header_REF7
Print "REF01_Reference_Identification_Qualifier4 "
Print REF01_Reference_Identification_Qualifier4
print "REF02_Reference_Identification5"
print REF02_Reference_Identification5





Next
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top