Good morning everyone,
I'm triying to get all the attachments' name and its upload/last modification date related to a set of defects in HPQC 12.01 using excel vba.Right now, I'm able to get the names of each attachment, but I can't get the uploading/ latest modification date, does anyone know how to do this?The code that I'm using is: (For each attachment get the attachment information from the Cross Reference table)
Set bugAttachments = bg.AttachmentsSet bugAttachmentList = bugAttachments.NewList("")Dim bgAttachmentSizeDim tmpHyp As HyperlinkDim hypAddress AsStringDim m AsIntegerDim Text AsStringDim CmdDim rs bgAttachments ="" m =0ForEach bugAttachment In bugAttachmentList'bgAttachments = bugAttachment.Field("CR_VC_CUR_VER") & "hola"Text ="SELECT * FROM CROS_REF WHERE CR_REFERENCE = '"& bugAttachment.Name &"'"Set Cmd = tdc.Command 'Create an SQL Command objectCmd.CommandText = TextSet rs = Cmd.Execute 'Create a recordset of the current attachmentIf rs.RecordCount >0Then'Ensure that the command returned a resultrs.First 'Get to the start of the recordsetbgAttachments = rs.FieldValue(1)&"#"& rs.FieldValue(2)&"#"& rs.FieldValue(4)&"##"EndIf
ActiveCell.Offset(0, 1).Select
ActiveCell.Formula = bgAttachments
hypAddress = ActiveCell.Value
Set tmpHyp = ActiveSheet.Hyperlinks.Add(Anchor:=Selection, Address:= _
hypAddress, TextToDisplay:=ActiveCell.Value)