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

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
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,214,614
Messages
6,120,519
Members
448,968
Latest member
Ajax40

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