Function getAttachmentFromQC(attachmentName)
Dim returnValue
Dim attachmentList
Set attachmentList = QCUtil.CurrentTest.Attachments.NewList ("")
For Each Attachment in attachmentList
Attachment.Load True, ""
If InStr(Attachment.FileName, attachmentName) Then
getAttachment = Attachment.FileName
End If
Next
End Function
Dim returnValue
Dim attachmentList
Set attachmentList = QCUtil.CurrentTest.Attachments.NewList ("")
For Each Attachment in attachmentList
Attachment.Load True, ""
If InStr(Attachment.FileName, attachmentName) Then
getAttachment = Attachment.FileName
End If
Next
End Function
Usage
This code imports the first sheet from a attached excel sheet
DataTable.ImportSheet getAttachmentFromQC("test_data.xls") ,1 ,1
No comments:
Post a Comment