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.
 
Read above, I had edited the code for you :) If your code is macro enabled then change the extensions to the macro enabled extension of the file if you know what i mean

EX. blah.xlsx, xlsx is an extension :P
 
Upvote 0

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Maybe this is me being dumb, but if I send my workbook to someone who can't gain access to that location they wont be able to attatch it surely?

I want everyone who uses the workbook regarding of their access to be able to send the PDF along with their emails, without sending them the PDF to save locally themselves.
 
Upvote 0
They will have access as long as the server they save it to gives them permission to access it :)

And yes they can send the pdf to others if you don't password protect the file or anything

NOTE: They don't need the code to attach files onto outlook :)
 
Last edited:
Upvote 0
Which is the problem haha! Sometimes they won't even have access to the server (Outside Sales guys etc) which is why i was focussing on using the already embedded file :D haha Maybe i should of been clearer! Attatching from a fixed location on the server is fine for me, but I won't be the one using the workbook.

To give a breif overview of what we're doing, it's a magical visual contraption that the outside sales guys will use to show customers, that gives then them an option to email everything back to the office to the Internal Sales guys to process it.

Not everyone will have access to the server, but they will have access to the workbook.
 
Upvote 0
But if you click the email button it'll pull it from the location/server that I have access to. They won't have that access and I'm not giving them a local file. It's got to be the embedded version, maybe it can't be done but we want everything to run through this one system. :p
 
Upvote 0
I'm sure it will be fine. I've downloaded many excel files and i've never got a location error but when i'm getting excel files from a server then it gives me a location error because that server is going into many other computers. I'd suggest sending it to each person that will be getting the file. :)
 
Upvote 0
Also you can copy and paste the file on the server onto the desktop of the persons computer and run it off of the computer instead of the server. :)
 
Upvote 0
"You want to share a excel file to a company and the pdf file is already saved into a excel file?"

Just seen this, sort of yeah. Excel file gets shared, within Excel file is a PDF. also within Excel file an button to email the Sales office, I want the already embedded PDF to accompany the email.



I think maybe I'm just confusing myself, sending the PDF with the Excel file is the easy option! ahha. Sadly it's not my call! Cheers though. :)
 
Upvote 0
Yeah I know how to link the file directly from a fixed location. It's just pulling it from an embedded sheet that I'm confused about!
 
Upvote 0

Forum statistics

Threads
1,215,420
Messages
6,124,800
Members
449,189
Latest member
kristinh

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