Convert Excel Sheet To PDF And Attach In Outlook And LOOP Using VBA?
Aug 7, 2014
Here is my code I got to work, however I have multiple excel files at a time.How do I not open the excel doc to run and add a loop to repeat the process for all files in the folder?
The MSG piece is critical and there is specific information needed in the body, can I add on to this?
CODE
------------------------------------------------------------------
Sub PDFEmail()
'Declare variables
Dim MyFilePath As String
Dim MyFileName As String[code]....
View 4 Replies
ADVERTISEMENT
Jan 30, 2012
I am looking for a macro that will convert the active sheet in an Excel 2010 file to a PDF, attach the PDF to an Outlook 2010 email message, and fill in the subject line and recipient address which are the same each time.
View 3 Replies
View Related
Jun 21, 2013
I am trying to create a script for a manually morning process that I need to complete that entials downloading a number of .PDF files and sending them out to a distribution list. I am unable to automate that actual saving of the files onto the network drive, but I believe I can automate the process of attaching them to the email. I have run across some problems so far though, this is what I have been able to come up with. After doing a bit of research it seems as though using cmd would be the best way to locate and attach the file but I am still unable to get it to run properly:
Code:
Sub AttachMultiple()
With CreateObject("Outlook.Application").CreateItem(0)
.To = "test@gmail.com"
.Subject = "Test"
.Attachments.Add Split(CreateObject("wscript.shell").exec("cmd /c Dir 'G:Client ReportingMGIDaily
ReportsAGFAJune 2013*.pdf' /b /o-d").stdout.readall, vbCrLf)(0)
.Send
End With
End Sub
Here is an example of a folder I will be trying to pull the most recent saved PDF from, there are about 10 similar folders:
I feel like I am relatively close to completely this, my cmd syntax may just be a little off.
View 5 Replies
View Related
Dec 16, 2002
How to covert a Excel worksheet to HTML format as outlook's stationary and then call out Outlook to send it as a normal HTML mail, not a attachment mail?
View 4 Replies
View Related
May 21, 2014
I have a sheet with an invoice on and wish the Macros to make it easy for users.
I have this code which saves as PDF, Prints and saves my worksheet. However I want to send the PDF to Outlook with To: and cc: completed using the Macro.
Sub PlasticParts()
'Saves active worksheet as pdf using concatenation
'of A1,A2,A3
Dim fName As String
With ActiveSheet
fName = .Range("A1").Value & .Range("F2").Value & .Range("A3").Value
.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"
[Code] ..........
View 1 Replies
View Related
Jun 10, 2014
I'm generating a letter (Word doc) and populating bookmarks with data on a worksheet using the following code which is assigned to a Button and it works a dream (in terms of opening the Doc and populating the bookmarks with whatever data is in the relevant cells on the worksheet):
Sub test()
Dim objWord As Object
Dim ws As Worksheet
Set ws = ThisWorkbook.Sheets("Sheet1")
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
objWord.Documents.Open "location of the letter.doc"
[code]......
However, what I now need to do is Create an Outlook Item (email) with a Standard Subject and send to an email address that will be on the same worksheet (in cell M2 for instance) and with a standard Body.
I dont really need to open the Word doc, like it does at present, but I do need the Bookmarks contained within it to be populated with the source data contained within the Worksheet and subsequently have it attached to the email fully populated - maybe I need to 'close' / 'save as & close' the Doc post generation?
View 6 Replies
View Related
Feb 7, 2014
I have two pieces of code that each work, but I am struggling to combine the two.
I started with Ron de Bruin's code to attach multiple files to an email and then found more code that will loop through a folder to attach multiple files to an email.
Essentially, I would like the structure of Ron de Bruin's code, with the ability to have folder paths in the cell range, rather than file names.
Here is the code that works to loop through a folder, but it only works when I have the paths listed in one column, not in a range (e.g. columns C-Z)
Code:
Sub Send_Indv_Files()
Dim OutApp As Object
Dim OutMail As Object
[Code].....
View 4 Replies
View Related
Mar 6, 2014
I have the need to convert regular emails to a excel sheet,
The emails are always sent from the same email address, and will have the same format ( however can contain small or large amounts of data eg 1 part number or 50 ).
sample email below
" PowerForce v4.00
Report : INR3050 v4.5
Title : EDI PURCHASE ORDER INBOUND ERROR EXCEPTION REPORT
For : ch3inl
Date : 05-Mar-14 06:06
[code]....
View 1 Replies
View Related
Apr 25, 2014
Due to one of our business requirement I have to fetch so many users Alias name through Outlook.
I am following below steps to achieve that Open new mail, giving user's name in to list, press ctrl+k, then right click properties. In properties I use to find alias name of user. I want to automate this process through excel sheet. I want to provide names in one column as Input to excel sheet and want to fetch alias name in next column of excel sheet.
View 1 Replies
View Related
Feb 12, 2014
I need to send an Outlook email from within an Excel sheet. I have a command button with the following codes:
-----------------------------------------------------------------------------------------------
Sub SendEmail_Inactive()
Dim OutApp As Object
Dim OutMail As Object[code].....
I need to be able to add more text/paragraphs in the Body of the email including bullet points
View 1 Replies
View Related
Mar 7, 2014
I have an excel workbook (Excel 2010) consisting on 30 sheets, I would like to add a command button to one (1) of the sheets that would attach just that sheet and not the whole workbook to my Outlook 2010 email, is this possible. What would the code look like.
View 1 Replies
View Related
Feb 20, 2014
I work for one half of a joint venture & am responsible for planning & expediting. The other half does purchasing. The bi-weekly PO download reports I receive are less than useful. I have already written the code to delete undesired sheets & add, format, and enter headers for a "Summary" sheet.
I need code to move to the next row, and run formulas to pull data from the next sheets, and repeat until there are no more sheets.
The number of sheets will vary from one download to the next, and the sheet names will vary from one download to the next.
Following are example formulas that need to be run on successive rows while pulling from successive sheets.
I am running Excel 2013 on Windows 8.1
View 14 Replies
View Related
Jan 29, 2009
I would like to attach a pdf (or word) file inside an Excel sheet so that it is seen as a pdf icon or word icon when viewing the sheet. Any of you who knows if this is possible and how to do it?
View 2 Replies
View Related
Dec 3, 2007
I have a workbook with a large number of worksheets in it. I intend putting the workbook onto a shared network drive so that a number of users can go into their individual named sheet - check some data and confirm that they have checked it.
My initial idea is to attach a command button to each individual sheet so that each user can click on the button to confirm that they have checked their data. What I would like to do is hide a worksheet within the workbook and when each user has checked their data - their button click will insert a tick in the relevant cell of the hidden worksheet e.g.
When User 1 clicks command button on User 1 sheet it will insert a tick in cell B2 of the hidden sheet
When User 2 clicks command button on User 2 sheet it will insert a tick in cell B3 of the hidden sheet
View 9 Replies
View Related
Dec 29, 2011
I have this Macro working almost perfectly, but I need to attach the worksheets to the emails. The code is below. I am unable to reference the ".Attachments" to the workbook created previously in the code.
Sub ActivityReport()
' Clear out any old data on Report
Sheets("Report").Select
[Code].....
View 1 Replies
View Related
Sep 19, 2013
show me the visual basic codes that allow me to attach the current saved workbook to an email (just attach, but not to send the file). So basically, just open the Outlook, send to, and attach the file.
View 6 Replies
View Related
Dec 8, 2010
How to convert Excel sheet to PDF file By VBA code.
View 9 Replies
View Related
Nov 14, 2009
I am using a macro to e-mail any work sheet with an address in A1. I would also like to attach a file that will be listed in cell E1 of that worksheet. The file is different for each work sheet that is being sent but will be listed in the same cell of each work sheet.
This is the code I am using (i got it from ron de bruin) when I use the .Attachments.Add (C:est1.txt) it works but i can not seem to figure out how to get it to read the file address in the E1 cell. The code i am trying to use is .Attachments.Add = ws.Range("E1").value.
View 3 Replies
View Related
Dec 4, 2012
I would like to send a Excel printing area to a mail recipient by using a macro that:
2) Save the printing area as a pdf - file - use a temporary filename
1) Opens MS Outlook mail
3) Attach the temp-file to the mail
View 6 Replies
View Related
May 30, 2014
I need a code to convert different excel files into pdf and send to different recipients.
View 3 Replies
View Related
Sep 30, 2013
How can I get this code to loop through every line on sheet?
Code:
Selection.Copy
Windows("SheetA.xlsm").Activate
Cells.Find(What:="Part Number", After:=ActiveCell, LookIn:=xlFormulas _
, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
[Code] ..........
View 2 Replies
View Related
Oct 9, 2012
I was wondering if anyone had any code to loop through every file in a folder and list the file name along with every sheet name in that file? I'm using Excel 2007.
View 4 Replies
View Related
Apr 15, 2014
Using EXcel 2013, Windows 8
I have an Excel worksheet with one column being e-mail addresses. Other columns are Christian names, etc
Ideally can I create a full Mail merge with Outlook using whatever data I want. But probably just e-mail address and Christian name?
Otherwise be able to send one e-mail to all the e-mail addresses, without a major re-type.
View 2 Replies
View Related
Feb 24, 2007
I know this has been discussed a number of times, but here is my problem
I have three charts in my workbook. I want to attach a macro so that when the chart is clicked it returns to Sheet - Home. I have using the following:
worksheets("Home").activate. But after I protect each chart and the workbook, and save and exit. When I reload the Workbook it has forgotten the assigned macros and nothing happens.
View 7 Replies
View Related
Apr 19, 2010
I have an Excel 2003 file that contains hyperlinks to OneNote notebooks on a Sharepoint site. An Excel macro looks for these links and determines the full hyperlink address which is then assigned to a variable. An Outlook message is generated which includes the hyperlinks.
The hyperlinks work in the Excel file. I can also copy them from OneNote and manually paste them into an Outlook message and they work. However, when I obtain their full address and transfer that to the email through code, the links do not work. The hyperlink address from OneNote starts with "onenote:http" which is not recognized as a link.
If I can do this manually, there must be a way to do this with vba. Are there characters I need to include in the OneNote hyperlink address to make this work? Is there another way to transfer the working link from Excel to Outlook?
View 3 Replies
View Related
Aug 29, 2012
I have attached a version of my file with code that I have adjusted. Everything is working except for the save as portion of it. I keep getting a run time error 1004. The save as of the workbook failed. Also, when I run the macro in the template that I have uploaded it opens up the original file that I had the code in.
View 2 Replies
View Related
Jul 21, 2014
link a date within a Excel sheet to the Calander in Outlook so a reminder can be triggered on said date.
View 2 Replies
View Related
Feb 2, 2014
I'm in search of a VBA macro which will send a mail through outlook automatically with the count of files(.pdf + .msg files) in any given folder.
I work for an organization, where we use Outlook for mailing purpose.
Everyday Inventory(.pdf files and .msg files) will be saved in a folder that is to be processed.
I want a macro which should automatically send the total inventory (.pdf files + .msg files) through my outlook mailbox(say: me@outlook.com) to a my superiors outlook mailbox(say: superior@outlook.com).
If the macro sends that email to my superior before me and my superior logon to computers at perticular time (say: 7:00AM daily), need to plan our day at work.
View 3 Replies
View Related
Nov 21, 2013
I have to send out emails to all of my staff with their new login ID's and PW's and other misc information one by one to each user. Reason being is that all ID's, PW's and other information pertains to that specific user and includes sensitive information.
I know there's a VBA script I can use to send out the emails, but the script I found online keeps crashing my Outlook and requires it to go through my personal inbox which takes 15 minutes every time.
I have the pertinent information split up into different columns/cells.
A1: email
A2: subject
A3: body (ID, PW, verbage)
A4: attachment link (if required)
A5: if I could have Outlook automatically stamp each email with my signature that'd be awesome as well.
View 4 Replies
View Related
Aug 3, 2007
a macro that will take my excel sheet (using office 2003) and then pasted it in outlook.
Also I need cell A1 and cell B1 pasted in the subject line.
View 9 Replies
View Related