How do i get filepath of open .xlt file

BigDelGooner

Board Regular
Joined
Aug 17, 2009
Messages
197
I am trying to email the activework I have open using the code below:

Set myOlApp = CreateObject("Outlook.Application")
Set myitem = myOlApp.CreateItem(olMailItem)
myitem.SentOnBehalfOfName = "S&Co - SAA Modelling"
myitem.To = recip
myitem.Subject = "Portfolio Modelling Request Completed"
myitem.Attachments.Add ActiveWorkbook.FullName
myitem.Display

I have 2 problems here:

- I know there are easier ways of sending the open workbook, however this is the only method I know that allows me to use the '.sentonbehalfofname' function.
- The sheet I am trying to send is an .xlt file so when this method uses the 'Attachments.Add ActiveWorkbook.FullName' line it actually attaches the original .xlt file and not the edited / open version on the screeen.

I guess if I could get the filepath of the open .xlt file rather than the original it would over come this problem!

PLEASE HELP!!! :biggrin:
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Thanks so much for the quick reply!

If i use the standard 'Application.Dialogs(xlDialogSendMail).Show' it does send the corrrect file.

If we attack it from the other side...is there a way I can add the 'sentonbehalfofname' variable to the standard 'Application.Dialogs(xlDialogSendMail).Show' email method..?
 
Upvote 0

Forum statistics

Threads
1,214,522
Messages
6,120,019
Members
448,938
Latest member
Aaliya13

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