MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Barrie! VB me

Posted by Ian on July 26, 2001 1:44 PM

have posted this question already but!

I have a button on my sheet and I want it to e.mail the file that it's on??

I have the e.mail part down no probs:
It saves the file (just incase there have been changes)
It sets the address to send to (I will be adding an input box later, so any ideas on how to access the intrenal mailing list would be nice :) )
It sets the subject: daily report for blah &(the date in a cell)
It puts a message in

The BUT is what line do I need that will ATTACH the file it's on.

the file will be in the same place all the time, but for future reference can VBA find out where it's just saved the file??

just one line would be a GOD send


the file will always

Posted by Barrie Davidson on July 27, 2001 6:41 AM

Hi Ian. As I understand it, your question is:
How do I get the saved file name including its path?

Assuming you have a variable FileName declared as a string, the following code will provide the full file name.

FileName = ActiveWorkbook.Path
FileName = FileName & "\" & ActiveWorkbook.Name

Is my understanding correct?