我正在使用下面的代码向Excel表格中添加".jpg"文件:
'Add picture to excel
xlApp.Cells(i, 20).Select
xlApp.ActiveSheet.Pictures.Insert(picPath).Select
'Calgulate new picture size
With xlApp.Selection.ShapeRange
.LockAspectRatio = msoTrue
.Width = 75
.Height = 100
End With
'Resize and make printable
With xlApp.Selection
.Placement = 1 'xlMoveAndSize
'.Placement = 2 'xlMove
'.Placement = 3 'xlFreeFloating
.PrintObject = True
End With
我不知道我在做什么错了,但它没有被插入到正确的单元格中,那么我应该怎么做才能将这张图片放入Excel中的指定单元格中呢?