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?
 

Some videos you may like

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

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?
 

Watch MrExcel Video

Forum statistics

Threads
1,109,349
Messages
5,528,188
Members
409,807
Latest member
nicky736

This Week's Hot Topics

  • Change military grades into rank
    Afternoon all Need help with formula that will change military rank (i.e. 1, 2, 3 into Amn, A1C, SrA). Running IF formula that does not work...
  • VBA COUNTIF SOLUTION
    Hi The following are the errors spread across the several columns from E to Q ie. 13 columns across several sheets with more than 500 rows per...
  • INSERT ROW WITH SPECIFIS TEXT IN A COLUMN
    Hi All! How can identify that that the row to be inserted has to be inserted before 1st row with specific text in column F. If I record the...
  • Auto-Create a monthly Sign in sheet for preschool students
    The image below is what each page looks like. Above is space for the "Child Name" "Month" "Class" School days are obviously Monday-Friday but...
  • VBA vlookup multiple results
    Hi folks, Hopefully someone out there can help. I have a list to vlookup which works (ish). the lookup only picks up the first instance of the...
  • Extract values for earliest/latest times
    I am trying to put together a formula to get the earliest start time, the latest end time from column A for each person in Column B-F without the...
Top