+ Reply to Thread
Results 1 to 13 of 13

Sending invite through Outlook 2007 via excel macro or VBA

  1. #1
    Registered User
    Join Date
    12-12-2012
    Location
    delhi
    MS-Off Ver
    Excel 2010
    Posts
    26

    Sending invite through Outlook 2007 via excel macro or VBA

    Hi Guys,

    I have a data attaching below, suppose i have 20 employee in one dept i want something from which i can select one dept and send them all invite for the start time.
    I want to send them an outlook invite subject as code.

    Please help me prepare something which can be useful. by adding some buttons or something where i can just send them all invites for a particular date in one dept.
    Outlook 2007 installed.
    Meeting Invite Data.xlsx

    Let me know if u have any questions. Thanks alot in advance

  2. #2
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Sending invite through Outlook 2007 via excel macro or VBA

    You may be interested in this:-
    Sending Mail Automatically via Excel VBA
    Regards,
    Vikas Gautam
    Excel-buzz.blogspot.com

    Excel is not a matter of Experience, its a matter of Application.

    Say Thanks, Click * Add Reputation

  3. #3
    Forum Contributor
    Join Date
    09-15-2011
    Location
    London
    MS-Off Ver
    Excel 2016
    Posts
    135

    Re: Sending invite through Outlook 2007 via excel macro or VBA

    Hi Vikas,

    it showing the error message the below mentioned line

    With ActiveSheet.MailEnvelope

    Thanks
    Raju
    Attached Images Attached Images

  4. #4
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Sending invite through Outlook 2007 via excel macro or VBA

    Its working fine for me.

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    Last edited by Vikas_Gautam; 03-05-2015 at 06:36 AM.

  5. #5
    Forum Contributor
    Join Date
    09-15-2011
    Location
    London
    MS-Off Ver
    Excel 2016
    Posts
    135

    Re: Sending invite through Outlook 2007 via excel macro or VBA

    Hi Vikas,

    Check,

    Thanks
    Raju
    Attached Files Attached Files

  6. #6
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Sending invite through Outlook 2007 via excel macro or VBA

    At my end code is working.
    Here is the snapshot.

    Code is working.PNG
    Last edited by Vikas_Gautam; 03-06-2015 at 02:19 AM.

  7. #7
    Registered User
    Join Date
    12-12-2012
    Location
    delhi
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Sending invite through Outlook 2007 via excel macro or VBA

    Hi Vikas,

    Im too new for all VBA coding sorry for that.
    I would paste the coding on a excel file rite..? and then run

    Also what all colums would i need to add on the sheet. I did attached a sheet in my first post i will have data in that format.
    I would have many people in one dept and would send them all an meeting invite not email for the start time at one go.

    Please help me on this , this would really mean alot if u could attach a excel file with the coding according to the tabs i mentioned on the sheet.
    Thanks alot in advance Vikas.Meeting Invite Data.xlsx

  8. #8
    Registered User
    Join Date
    12-12-2012
    Location
    delhi
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Sending invite through Outlook 2007 via excel macro or VBA

    Guys please help me on this..

  9. #9
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Sending invite through Outlook 2007 via excel macro or VBA

    Okay Kartik,
    Can you tell me how should i refer following variables ?
    I mean, Is it from sheet itself or some Separate text.

    .MeetingStatus = olMeeting
    .Subject = " Wedding Reception - Ramya & Mohan "
    .Location = " PJN Mahal, #10, Egabaram Salai, Udaya Nagar, Porur, Chennai 116 "
    .Start = "28-12-2013 07:00 PM"
    .Duration = 150
    .Body = strBody

  10. #10
    Registered User
    Join Date
    12-12-2012
    Location
    delhi
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Sending invite through Outlook 2007 via excel macro or VBA

    Meeting Invite Data 1.xlsx

    I have attached a new sheet with the details to be mentioned on the invite.
    the data will on a excel sheet.

    Body can be empty.
    Thanks

  11. #11
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Sending invite through Outlook 2007 via excel macro or VBA

    First make reference to the Microsoft Outlook xx.xx Library in the VBA window ---> Tools menu --> References option.
    then use following code:-
    HTML Code: 
    Sub Send_Invite()
        
        Dim olApp As Outlook.Application
        Dim olApt As AppointmentItem
        
        Set olApp = New Outlook.Application                 'Creating Outlook Session
        
        For i = 2 To Cells(Rows.Count, "D").End(xlUp).Row
            Set olApt = olApp.CreateItem(olAppointmentItem) 'Creating an Appointment
            With olApt
                .Subject = Cells(i, "D")
                .Start = Cells(i, "C") + Cells(i, "E")
                .Recipients.Add Cells(i, "F")
                .MeetingStatus = olMeeting
                .Location = "Office"
                .Display
            End With
            Application.Wait DateAdd("s", 1, Now)           'waiting for 1 sec to let OL window to display.
            SendKeys "%s", True
            Set olApt = Nothing
        Next
        
        MsgBox "Invites Sent", vbInformation
        
    End Sub
    Code is working for me.
    Remember to start ms outlook before using the above code.
    Last edited by Vikas_Gautam; 03-09-2015 at 05:12 PM.

  12. #12
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Sending invite through Outlook 2007 via excel macro or VBA

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  13. #13
    Registered User
    Join Date
    12-12-2012
    Location
    delhi
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Sending invite through Outlook 2007 via excel macro or VBA

    Will do. Thanks again for the help. Really appreciate it.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] VBA Macro to print to Pdf format and place as attachment in Outlook (Excel & Outlook 2007)
    By Webman1012 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-29-2013, 01:25 PM
  2. Macro for sending filtered data to multiple recipents (excel/outlook 2007)
    By tkowon in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-15-2012, 03:31 PM
  3. Replies: 1
    Last Post: 09-20-2008, 05:34 PM
  4. [SOLVED] Excel macro's deleted when sending through Outlook
    By Phreake in forum Excel General
    Replies: 3
    Last Post: 07-20-2006, 08:30 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1