CDO attachment question

austin350s10

Active Member
Joined
Jul 30, 2010
Messages
321
Is there any way in the world to send an attachment using CDO with the attachment as a variable instead of the full file path?

My problem is that where I am using my save-and-mail script the users machines will not allow them to save a file on the C:\ drive but that is the only place I can think of that would be the same on all computers. Maybe there is a file path that is more accessible than the root C:\ drive. Any ideas?

Right now I have a beautiful script that saves the active sheet to the desktop of any machine but it only has the ability to save the file path as a variable which is why I really want to find a way to send an attachment as a variable but it has to be done using CDO not Outlook or any other email client.

My understanding is that this cannot be done but I am wondering if anyone knows about a work around??
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
that is the only place I can think of that would be the same on all computers

Assuming all your users are using the Windows OS, you could try something like this:

ChDir ("C:\Documents and Settings\" & Application.UserName & "\Local Settings\Temp")

as all should have this temporary directory.
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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