Attatching an already embedded PDF to an Email.

CBurgess

Board Regular
Joined
Oct 29, 2013
Messages
65
Okay, my problem is as follows:

My "Drawing" is embedded on Sheet1, later on in Sheet12 I click a button that'll send an automatic email to a user. I want to attatch the embedded PDF onto this email if it is at all possible??

Code:
  Dim Drawing As Object

After I've declared my variables I've tried setting the variable "Drawing" to the object, this is where I'm encountering my errors mainly "Type Mismatch" or Object Variable not set...


Code:
    Sheets("Menu").Visible = True
    Drawing = Sheet1.Shapes.range(Array("Drawing"))
    Selection.Verb Verb:=xlPrimary
    Sheets("Menu").Visible = False

At the bottom of the code, this is where i pull in the object

Code:
        .To = Sheet12.range("L8")
        .CC = ""
        .BCC = ""
        .Subject = "Arrange P&D Request"
        .htmlbody = strbody & vbNewLine & Signature
        .Attachments.Add ("Drawing")

Cheers guys, you're help is appreciated.
 
What i mean't about that was "for" the person who is getting the files can copy the file onto their desktop so that it won't give a location error.
 
Upvote 0

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Yeah that's still an escape around, I don't want to have to do that. It defies the point of the question, I know how to link to another file, but I wanted to link it to the file that's already embedded. So it wouldn't require another location, just pull the already embedded file and attatch a copy of it to an email.
 
Upvote 0
That's basically how the code works but you can't change how the location works. But you can just make the person that receives it save it to their desktop.
 
Upvote 0
Yeah i get that, thank you anyway.

I just didnt want to have to go down the route of making anyone save anything to anywhere. I wanted it to be all internal inside one file. If it can't be done, it can't be done.
 
Upvote 0
Yeah i get that, thank you anyway.

I just didnt want to have to go down the route of making anyone save anything to anywhere. I wanted it to be all internal inside one file. If it can't be done, it can't be done.

Yeah sorry.. If you want better answers to your solution then you can go to other forums that MrExcel is affiliated with :D
 
Upvote 0

Forum statistics

Threads
1,215,426
Messages
6,124,828
Members
449,190
Latest member
rscraig11

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