So my knowledge of VB is basic but i do still understand ...
I have the following code ..
Sub Macro2()
'
' Macro2 Macro
[Code]....
This is ment to attach the worksheet "Detailed Report" as a PDF. So far i can get it reference the email and the subject but how do i add a body part ?
Also the attached file only comes across as an excel file, and its the whole book.
I have a macro that is currently set up to save a draft of my email from Excel. Feedback I've received from my peers is that they would like this macro to Open the drafted email it creates instead of the user having to navigate to the draft folder to open it up.
Is there a part of the code below I can modify so this happens?
//Sub Mail_workbook_Outlook_1() Dim OutApp As Object Dim OutMail As Object Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(0)
I have a template invoice in excel. What I want is a macro code that when it is run the open template invoice should be sent to a specific email address !!
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.
How to modify the below vba code? It sends an email with an attachment right away after pressing the macro button. I would like the user to see the email in outlook before it gets send... and then press 'send' in Outlook .....
Sub Mail_ActiveSheet() 'Working in Excel 2000-2013 'For Tips see: http://www.rondebruin.nl/win/winmail/Outlook/tips.htm Dim FileExtStr As String Dim FileFormatNum As Long
So i want to be able to send a single Excel sheet to a recipient, not already pre-defined in the VBA. I am trying to get to where i can click a button/link and a window pops up, asking me to enter recipient's email address. When I enter the address and press- 'Send', the email is sent using Outlook.
creating workbook with macros or vba code. I have a workbook that has several sheets.
The first sheet (All Students) has a table / range of student information. There are several other sheets one for each teacher, that would contain the student information from first sheet for that teacher. Teacher name is in one of the columns on the first sheet(All Students). What I'm looking to to do is create a workbook that would contain all Students in first tab/sheet, data will be entered into first sheet by teachers.
When I click on any of the teacher tabs excel should get data from (All Students) tab / sheet and populate teacher sheet with data for that teacher based on teacher column in All Students. Any suggestion on how to create this workbook. I've attached a sample workbook with data. I would like to make sure data refreshes when I click on teacher sheet.
I have searched and not found a solution. I have a project that requires the item to be printed on two different types of paper from a printer. The only way i have found to change trays is the sendkeys option. But it looks like sendkeys cannot send, then pause, then send. ex:
' first select the correct printer Application.ActivePrinter = "\hagenCopy Room Savin 4045 PCL6 on Ne05:" ' next set change printing options, presses ok to print Application.SendKeys "%fp%r+{TAB}{RIGHT}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{UP}{UP}{UP}{UP}{UP}{UP}{DOWN}{DOWN}~%c3~", True ' next set change printing options to other color tray, presses ok to print Application.SendKeys "%fp%r+{TAB}{RIGHT}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{UP}{UP}{UP}{UP}{UP}{UP}{DOWN}{DOWN}{DOWN}~%c1~", True
How would one insert a working pause inbetween the two sendkeys (a wait just waits before the beginning of the first sendkey. and then the 2 try to execute at the same time calcelling both)
1. I dont want this to auto send. I want it to compose the mail and leave it ready to hit the send button in lotus notes. How do I do that?
2. Would like to include multiple emails. If I put two emails (separated by comma or semicolon into cell C19, Lotus notes sends as one address and it bounces. (This is not terribly important, but would be a nice feature)
3. Would like to insert the signature line that's already configured on lotus notes. Since this auto sends the email, the signature is not added. Any idea how to do this?
4. Now this would be really nice, tell the macro which database to use. The one I want to use is not "my" email, but a shared email. It lives on server "Notes1/recovery" , in folder "mail" with a database named "company.nsf". Is there a way to do this?
Here is my code that works, but needs the above features.
Sub SendNotesMail() Dim Maildb As Object Dim UserName As String Dim MailDbName As String Dim MailDoc As Object Dim Session As Object Dim Recipient As String Dim Subject1 As String Dim ccRecipient As String
I have a code that i got from here which will send the Workbooks named in col A to email addresses in col B, as below..
but i need it to send the named Worksheets from the currently active Workbook.
The name of the Worksheet will be contained in col A.
Sub SendWkbs() Application.ScreenUpdating = False Dim wks As Worksheet Dim iRowA As Integer, iRowB As Integer Set wks = ActiveSheet iRowA = 2 On Error GoTo EH Do Until IsEmpty(wks.Cells(iRowA, 1)) iRowB = 2
I am making custom time sheets to suit our agriculture business - these excel sheets get sent out to the different farm managers who send back in staff times.
This code below is brilliant and works perfect for our needs. However I need to be able to emailPDF the sheets not print.How / where do I change code so the selected sheets go to Save & Send via email as a PDF instead of going straight to the default printer .( hard copy )
VB: Option Explicit Sub SelectSheets() Dim i As Integer Dim TopPos As Integer Dim SheetCount As Integer Dim PrintDlg As DialogSheet
I want to send the value of selected item in texbox , the value format is change by combobox value ..and I want the value is fill on the next column of sheet ( see attached file please)
i want to know how to show the progress of code exceuted in an excel sheet. like when we download a file from web or server it shows the staus of the file transfer.
i have this code to populate the worksheet from listbox selections, but it only works on a 'one at a time' basis.
Private sub cb1_click() Dim i As Integer Dim Ltm As String
With ListBox1 For i = 0 To .ListCount - 1 If .Selected(i) = True Then If Ltm = "" Then Ltm = .List(i) Else Ltm = Ltm & ", " & .List(i) End If End If Next i End With
With ActiveSheet .Range("B" & .Rows.Count).End(xlUp). _ Offset(1, 0).Value = Ltm End With For i = 0 To ListBox1.ListCount - 1 ListBox1.Selected(i) = False Next
what i am trying to do is once i have checked several items in the listbox is have all of the checked choices fill iin column B at once.
I used Scheduled Task to set up my spreadsheet to open daily. I have the code with assistance to pull out the due date items and place them into an email.
I have come across XLSTART/AUTOEXEC/ACTIVATE...ETC... But cannot figure out the code that will automatically "enabling macro" once Scheduled Task opens the spreadsheet?
Then once the macro runs, the email with the due dates, how can this auto send without user interaction? (currently I would have to hit send)
I am trying to make the process totally automated to open the spreadsheet at a certain time, send the email with due dates and close the spreadsheet.
Following code in ThisWorkbook--
Private Sub Workbook_Open() Check_Date_Send_Mail End Sub Code in Module1--
Option Explicit Sub Check_Date_Send_Mail() Dim wbBook As Workbook Dim wsSheet As Worksheet Dim rnDate As Range, rnValue As Range Dim stAddress As String, stMsg As String Dim stRecipient As String, stSubject As String Dim stPost As String Set wbBook = ThisWorkbook Set wsSheet = wbBook.Worksheets("Sheet1") With wsSheet Set rnDate = .Range("d2:t23") End With
I have a macro that will send an excel workbook by email when an image is 'Clicked on' however, I need the attachment to be renamed as the text used in cell B9 of this worksheet.
So far I have the macro below which auto populates the 'email to' address and the 'subject' line which is great but how do I get to rename the attachment?
Sub SendIt() Application.Dialogs(xlDialogSendMail).Show arg1:="test@test.com", _ arg2:="test 1" End Sub
I'm using some code to send an email from Excel to Outlook via VBA, I of course got it from [URL]
I'm using it to send a mass email to some of our customers, it uses information from a sheet and then attach's some PDF files totalling 5MB.
The trouble I'm having is that I can send around 16 emails and then the mailbox reaches it's limit and it just comes to a halt until I can empty the 'Sent Items' and then the 'Deleted Items' folder.
I've spoke to the tech guys here at work about it and they seem to be doing a lot of shaking their heads about increasing the size of the mailbox () so I'm wondering if I can the routine automatically delete the email once it's been sent... ?
Here's the code I've got dealing with the mail;
Code: Set OutApp = CreateObject("Outlook.Application") OutApp.Session.Logon Set OutMail = OutApp.CreateItem(0)
I am trying to make a macros for sending an email through excel using outlook.
The body of the email should contain ..(The following case has been processed and ready for Quality Check and also picks the case# from Cell "C3" and "D3")
The subject line should say "Case Processed and take the case # from Cell "B2".
Im looking to create a reporting mechanism for a shared worksheet that im putting together.
I am looking to create some that will automatically create an email (either through outlook, or using a userform) and automatically populate with my email address in the 'To' section and automatically populate the subject with 'Error/Info Change'. The user can then populate the main email body with whatever they want to notify me of.
Im then hoping that the code can be run through a macro which has been added to the quick access toolbar.
I use a script to send email from excel. The script is perfect however there is one nagging problem. Everytime an email is sent, outlook keeps on asking me for permission that a program is automatically trying to send an email.
How do I get around this and disable this notification?
I am currently sending email to a few people from excel using the outlook and excel connectivity.
The issue is I have to individually define a module for each person I send an email to and it is extremely inefficient.
My attachment makes it clear.
There is 3 tabs in the workbook.
Tab 1 (Method 1) is what I am currently using and I know it extremely inefficient
Tab 2 (Method 2) is what I would like to use * When I select a cell and click send email, I would like for that person to be sent the email * When I select a range of cells, I would like all of those individuals to be sent an email
Tab 3 (Email) is what I would like Method 2 to use - this tab includes a subject line and the email body. It sends the message in the email tab to the recipients I have selected in Tab 2.