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

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
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,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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