excel macro to delete file attachment from email after it was installed

Alwinaz

Board Regular
Joined
Feb 7, 2012
Messages
201
Hi there

Is there a way to destroy an excel file if it was send as an email attachment. I have a file Funmathicx.xlsm which i am sending via email. When the user open the file they will only see the instruction page and the rest of the worksheets are hidden. there is an install button on the sheet which creates a folder Funmathics under my documents and then save the file in that folder. Once it is saved i want a macro which will destroy (delete the file attachment) so that it can not be forwarded to other people. Is it possible to do something like this?
 

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.

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
If you Google for 'remove email attachment vba' you will get lots of hits. You can use the Attachment's Delete or Remove method.
 

Alwinaz

Board Regular
Joined
Feb 7, 2012
Messages
201
Most of the post that i saw, gives vba that you put in you outlook. I am looking for vba to put in my excel file and not outlook.
 

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
You can automate Outlook from Excel but I don't know how you would find the Email that contained the attachment.
 

Alwinaz

Board Regular
Joined
Feb 7, 2012
Messages
201
So is it then not possible to write a macro/vba in excel to destroy/delete file content after running the install macro?
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,301
Messages
5,836,493
Members
430,436
Latest member
fefenouil

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
Top