Hi Guys,
basically as stated above. On a xls sheet I want to specify the area which then is turned into a pdf and directly sent (via outlook). Anything in mind?
Many thanks
Hi Guys,
basically as stated above. On a xls sheet I want to specify the area which then is turned into a pdf and directly sent (via outlook). Anything in mind?
Many thanks
Last edited by Konsti1989; 12-04-2012 at 12:19 PM.
Yes, record a macro while you carry out the actions. You'll get something like:Anything in mind?
Please Login or Register to view this content.
Which can be tidied up to:
Please Login or Register to view this content.
Then you just need the code to attach it to an Outlook email. You should be able to get that from anywhere. But, to save you some time, have a look at Ron de Bruin's web site.
Regards, TMS
Trevor Shuttleworth - Retired Excel/VBA Consultant
I dream of a better world where chickens can cross the road without having their motives questioned
'Being unapologetic means never having to say you're sorry' John Cooper Clarke
Tbh, i know about ron de bruin's stuff...however have no clou how I would combine the above. Jst put it at the beginning (?) doesnt work, yet it soednt feel right neither...every help appreciated!
Many thanks again.
I use this subroutine to send an email. I pass it the email address (a string), the subject (a string), the body text (a string), and the names of two files (again, both strings).
So, you'd run the first routine to save the selection as a pdf file and save it somewhere and then you'd call this routine to display/send the email.
Please Login or Register to view this content.
My source and invoice file names are Excel files (.xslx), hence the Left( ... ) & ".pdf" structure ... you can just pass across the full path/file name that you used to save the .pdf file.
Regards, TMS
Hi,
thanks a lot, both codes work finse seperately i.e. using only ur first code, a pdf is created...however when I add the code for the email, the file is not attached. Any idea what I did wrong? ( I put the path in for ".pdf").
Also for me it didnt work to put reference to a cell for the email adress i.e. instead of putting the email adress in the code, I would like to put it on a worksheet which I reference to in the actual code...
Many thanks
OK, I know we're in the same country, but my eyesight isn't that good.Please Login or Register to view this content.
How about you post a sample workbook with some typical data and the code in place?
Regards, TMS
I will prepare it.
besides, is .To = ws.Range("A1").Value the correct command to use the email adress which is in A1 in that case?
Something like that. It would depend on how your code is structured and what variables are defined.
Regards, TMS
Book1.xls
See attached the file....right now I only have the email component from your code which works fine BESIDES that it doenst attach anything (when I put a path in where it says ".pdf").
How would u incorporate the pdf-creater? Also the range should be A3:Z23, however it would be best when the code takes always the range A3: Z where it says "end"...any ideas? (now with the sheet )
Thanks a lot!
Please Login or Register to view this content.
Regards, TMS
With the variable end position:
Please Login or Register to view this content.
Regards, TMS
many thanks!
1st one works perfect....2nd unfortunately creates the file and sets up the email perfectly, however doesnt attach it to the mail. Any ideas why that is?
No. The only difference is that the second tries to determine the end position based on the word "End" in column Z.Any ideas why that is?
Apart from that, the code should be identical. Have you edited the file name in exactky the same way in them both?
Regards, TMS
u are right....works fine as well! what would be the change to do for saying that it stops before the end (i.e. that "end" doesnt appear on the pdf, but the range stops just before "end")?
cheers
Please Login or Register to view this content.
Regards, TMS
If you are satisfied with the solution(s) provided, please mark your thread as Solved.
New quick method:
Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.
Or you can use this way:
How to mark a thread Solved
Go to the first post
Click edit
Click Go Advanced
Just below the word Title you will see a dropdown with the word No prefix.
Change to Solved
Click Save
Done...
Works perfectly...thanks a lot!
You're welcome
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks