Gajju
Gajju

Reputation: 443

How to copy Image from on workbook to another which is generated at run time

I have a workbook 'w1'. I have a code inside a button which copies the data from book 'w1' to a new book 'w2'. Here book 'w2' is generated when the button is pressed. Now I want to copy an image form 'w1' to 'w2' using the same button. Below is the code that I wrote inside the button to copy the image from 'w1' to 'w2'. But its throwing an error "object dosen't support this property or method"

W1.Sheets("conf").Shapes("Image1").Copy
w2.Sheets("Sheet1").Range(w2.Sheets("Sheet1").Cells(20, 1), w2.Sheets("Sheet1").Cells(21, 1))_         
.Paste 

Does it copies the image with same size and shape or fits it in range of cells entered

Upvotes: 1

Views: 93

Answers (1)

L42
L42

Reputation: 19727

Try something like:

w2.Sheets("Sheet1").Paste

Upvotes: 2

Related Questions