VBA inter-workbook行动 – 每次我修复错误的错误

我有一些非常简单的代码,但每次修复问题时都会遇到错误。 不知道我是不是在做一些完全错误的事情。 我所要做的就是将另一个驱动器上的工作簿中的一系列单元格复制到ThisWorkbook作为图片。

第一个攻击计划:

 Dim BBPic As Workbook Dim test As Workbook Set BBPic = Application.Workbooks.Open("\\OtherDrive\Shared\OtherGroup\DailySheet.xlsx") Set test = ThisWorkbook BBPic.Sheets("Sheet1").Range("B2:E16").Copy test.Sheets("Summary").Range("B64").Pictures.Paste 

错误结果: Object doesn't support this property or method test.Sheets("Summary").Range("B64").Pictures.Paste

所以我基于这个post更多的分解了它,但是我不太明白他们在做什么。

第二次尝试:

 Dim BBPic As Workbook Dim test As Workbook Set BBPic = Application.Workbooks.Open("\\OtherDrive\Shared\OtherGroup\DailySheet.xlsx") Set test = ThisWorkbook BBPic.Sheets("Sheet1").Range("B2:E16").Copy test.Sheets("Summary").Select ActiveSheet.Range("B64").Select ActiveSheet.Pictures.Paste 

结果错误:在test.Sheets("Summary").SelectSelect Method of Worksheet class failed

然后,我提到这个post,但似乎我做了同样的事情,但只是一种不同的方式。 现在我不知道该怎么做。 任何帮助?

这将工作:

 Dim BBPic As Workbook Dim test As Workbook Set BBPic = Application.Workbooks.Open("\\OtherDrive\Shared\OtherGroup\DailySheet.xlsx") Set test = ThisWorkbook BBPic.Sheets("Sheet1").Range("B2:E16").CopyPicture test.Sheets("Summary").Range("B64").PasteSpecial