Copy Image from Closed Book & Paste in open

MarkOW

New Member
Joined
Jun 26, 2018
Messages
35
Hi,

I have two workbooks.

I am looking to copy an Image from the closed book (Image Source) and paste it into the open book (Source Portfolio.xlsm).

The Images are signatures and have been named to correspond with the staff names stored in ComboBox1

ie. J Bloggs would have a signature image named J Bloggs.

Coming up with error '438 - Object does not support this property or method.'

any help would be greatly appreciated.

Thanks

Mark

Office 365 - Windows 10

Rich (BB code):
    Workbooks.Open Filename:="C:\Users\\Documents\Image Source .xlsx"



    ActiveSheet.Shapes.ComboBox1.Value.Select
    Selection.Copy
    ActiveWindow.Close
    Range("P8").Select
    Windows("QPEO2 Source Portfolio .xlsm").Activate
    ActiveSheet.Pictures.Paste Range("P8")
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Try replacing...

Code:
    ActiveSheet.Shapes.ComboBox1.Value.Select
    Selection.Copy

with

Code:
    ActiveSheet.Shapes(ComboBox1.Value).Copy
 
Upvote 0
Assuming that you want the image pasted into the active sheet, your code can be re-written as follows...

Code:
    Dim wksDest As Worksheet
    Dim wkbSource As Workbook
    Dim shpSource As Shape
    Dim strImageName As String
    
    strImageName = ComboBox1.Value

    Set wksDest = ActiveSheet
    
    Set wkbSource = Workbooks.Open(Filename:="C:\Users\Documents\Image Source.xlsx")

    Set shpSource = wkbSource.Worksheets(1).Shapes(strImageName)

    shpSource.Copy
    With wksDest
        .Paste .Range("P8")
    End With
    
    wkbSource.Close SaveChanges:=False
 
Upvote 0

Forum statistics

Threads
1,214,951
Messages
6,122,442
Members
449,083
Latest member
Ava19

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top