delete button from workbook

User avatar
sal21
PlatinumLounger
Posts: 4353
Joined: 26 Apr 2010, 17:36

delete button from workbook

Post by sal21 »

I have this sheet, and i send it via outlook code:

(part of code)

...
'here code to delete the button
ThisWorkbook.Sheets("TEMPLATE").Copy
Set WB = ActiveWorkbook
WB.Sheets("TEMPLATE").Name = Replace(NOME_SHEET, " ", "_") & "-" & Format(DATA1, "DDMMYYYY")
....

but before to send is possible to delete the "pulsante 1"?
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78416
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: delete button from workbook

Post by HansV »

If you want to delete the button from the copy, use

...
Set WB = ActiveWorkbook
WB.Sheets("TEMPLATE").Shapes("Pulsante 1").Delete
...

If you want to delete the button before copying the TEMPLATE sheet, use

...
ThisWorkbook.Sheets("TEMPLATE").Shapes("Pulsante 1").Delete
ThisWorkbook.Sheets("TEMPLATE").Copy
...
Best wishes,
Hans