我正在使用下面的代码将文件附加到 Excel 工作表中,它可以工作,但文件放在其他文件之上。如何将文件单独放置在每个单元格中?
For Each elAtt In AttachList
Set MyAtt = Bug.Attachments.Item(elAtt.ID)
MyAtt.Load True, ""
'MsgBox MyAtt.Filename
ActiveSheet.Cells(i, 2).Value = MyAtt.Filename
ActiveSheet.Cells(i, 3).Value = MyAtt.Description
ActiveSheet.Cells(i, 4).Select
ActiveSheet.OLEObjects.Add Filename:=MyAtt.Filename, Link:=False, DisplayAsIcon:=False, Left:=40, Top:=40, Width:=20, Height:=10
'ActiveSheet.Cells(i, j).Value = Left(MyAtt.Filename, InStrRev(MyAtt.Filename, "\") - 1)
'theFileName = MyAtt.Filename
'thePath = Left(theFileName, InStrRev(theFileName, "\") - 1)
Set MyAtt = Nothing
i = i + 1
Next