14.51
Category: UFT
How to use Excel workbook.saveas with automatic overwrite
excelObject.DisplayAlerts = False
Set excelObject = CreateObject("Excel.Application")
excelObject.DisplayAlerts = False
Set wb = excelObject.Workbooks.Add
fullFilePath = importFolderPath & "\" & "A.xlsx"
wb.SaveAs fullFilePath, AccessMode:=xlExclusive,ConflictResolution:=Excel.XlSaveConflictResolution.xlLocalSessionChanges
wb.Close (True)
https://stackoverflow.com/questions/14634453/how-to-use-workbook-saveas-with-automatic-overwrite
Insight Object tips
simple differences in the image like colored pixels or lines may make a difference. Add/Set the “similarity” property and set the value to 60 for example this will ignore minor differences.
How to get a cell value in WinListView object
Use the method GetSubItem.
GetSubItem row, column
Rows and columns are zero based.
So getting the first row, second column is
getsubitem 0,1
MS Script Debugger missing – solved
When installing QTP/UFT you select to install Microsoft Script Debugger.
Now MS removed it from their site.
see here for solution (download and install it manually)
http://www.learnqtp.com/ms-script-debugger-error-uft/
the file name is scd10en.exe/zip so you can search for it yourself.
VBScript: Add Leading Zero to Date Function Output
http://sogeeky.blogspot.co.il/2006/08/vbscript-add-leading-zero-to-date.html
Summary:
strDate = DatePart(“yyyy”,Date) _
& Right(“0” & DatePart(“m”,Date), 2) _
& Right(“0” & DatePart(“d”,Date), 2)
getting the result path in UFT
In Environment variable ResultDir