When copying Excel sheet to a new workbook, images are not being copied VBA

Bellatrix461

New Member
Joined
Sep 7, 2020
Messages
8
Platform
  1. Windows
Hello all,
I have created the VBA code to copy an Excel sheet to a new workbook in .xlsx format as I need the new workbook to be free of macros. However, the sheet I'm copying has the company's logo and I need it to be on the new workbook as well. However, is not doing it.

The code I'm using to copy the sheet to a new workbook is:

Sub SaveAsName()

Sheets("WWW").Copy
ActiveWorkbook.SaveAs Filename:="TEST FILE " & Range("G13") & ".xlsx"
Application.DisplayAlerts = False

End Sub

You may see attached a screenshot on how it looks the original file and the new workbook after running the macro. The "New" button should not be included in the new workbook (which is ok now because is not showing) but the logo (called Picture_6) it should.

Thank you for all your help!
 

Attachments

  • After running macro file.JPG
    After running macro file.JPG
    53.1 KB · Views: 27
  • Original file.JPG
    Original file.JPG
    64 KB · Views: 27

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Hi and welcome to MrExcel.

Try this:

VBA Code:
Sub SaveAsName()
  Application.CopyObjectsWithCells = True
  Sheets("WWW").Copy
  ActiveSheet.DrawingObjects("New").Delete
  ActiveWorkbook.SaveAs Filename:="TEST FILE " & Range("G13") & ".xlsx"
    Application.DisplayAlerts = False
End Sub
 
Upvote 0
Hi and welcome to MrExcel.

Try this:

VBA Code:
Sub SaveAsName()
  Application.CopyObjectsWithCells = True
  Sheets("WWW").Copy
  ActiveSheet.DrawingObjects("New").Delete
  ActiveWorkbook.SaveAs Filename:="TEST FILE " & Range("G13") & ".xlsx"
    Application.DisplayAlerts = False
End Sub


Thank you so much,@DanteAmor !! This worked perfectly! :D
 
Upvote 0
I'm glad to help you. Thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,206
Members
452,618
Latest member
Tam84

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