0

I have some pretty simple code but I keep running into errors every time I fix something. Not sure if I'm just doing something completely wrong. All I'm trying to do is copy a range of cells from a workbook on another drive into ThisWorkbook as a picture.

First plan of attack:

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

Error that results: Object doesn't support this property or method on test.Sheets("Summary").Range("B64").Pictures.Paste

So I broke it down more based on this post but I didn't quite understand what they were accomplishing.

Second attempt:

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

Error that results: Select Method of Worksheet class failed on test.Sheets("Summary").Select

Then I referred to this post but it seemed like I was doing the same thing but just a different way. Now I don't know what to do. Any help?

Community
  • 1
  • 1
plankton
  • 369
  • 5
  • 21

1 Answers1

1

This will work:

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
Kyle
  • 2,543
  • 2
  • 16
  • 31
  • I got the `Object doesn't support this property or method` error on `test.Sheets("Summary").Range("B64").Paste` – plankton Aug 29 '16 at 15:52
  • The workbook I'm trying to copy from has Bloomberg formulas in it, if that makes a difference. I have Bloomberg so I don't think there would be an issue. – plankton Aug 29 '16 at 15:53
  • 1
    Bloomberg formulas won't make any difference for this. I changed it to `.PasteSpecial`. That will correct it. – Kyle Aug 29 '16 at 16:02