Micro Focus QTP (UFT) Forums
How to append date to xls file using qtp datatable methods? - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: How to append date to xls file using qtp datatable methods? (/Thread-How-to-append-date-to-xls-file-using-qtp-datatable-methods)



How to append date to xls file using qtp datatable methods? - yona34 - 05-03-2018

append date to xls file using qtp datatable methods?

I'm working on UFT datatable methods and i'm exporting test results to xls file with the help of Datatable exportsheet methods and i want to add test execution time and date end of the xls file and my code is.



Code:
'Export Test Results into TestResults Folder with Test Cases
DataTable.ExportSheet "D:\QTP_Automation\Test_Results_AutomationTesting_Results.xls","TestCases"
DataTable.ExportSheet "D:\QTP_Automation\Test_Results_AutomationTesting_Results.xls","TestSteps"
DataTable.ExportSheet "D:\QTP_Automation\Test_Results_AutomationTesting_Results.xls","Customer_Enrollment"
DataTable.ExportSheet "D:\QTP_Automation\Test_Results_AutomationTesting_Results.xls","Update_Customer"
And my file should looks like below

Test_Results_AutomationTesting_Results_20180430_timestamp.xls



RE: How to append date to xls file using qtp datatable methods? - Ankur - 05-04-2018

Are you facing issues in capturing current date and time from your machine? 

If yes, check the date and time functions available in VBA. Simply capture them in a variable and put them in your sheet.