Results 1 to 3 of 3

Create pdf of active sheet and send to email recipient contained in cell use default mail

Threaded View

  1. #1
    Registered User
    Join Date
    07-31-2012
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel Mac 2011
    Posts
    4

    Create pdf of active sheet and send to email recipient contained in cell use default mail

    Hi guys, new to the forum and VBA coding. Already learnt heaps reading through the stickies and previous threads. Been searching for a similar already solved problem but can't find it exactly.

    Have been trying to use RDB's coding for these but keep getting compile errors. Saw one of the experienced contributors put this forward for a different problem, is it possible to tweak the below coding to compile a pdf of cells B1:I56 and send to recipient in L4 on button activation using default email program?


    Sub sendEmail()
    Dim OutApp As Object
    Dim OutMail As Object
    Dim dataWs As Worksheet
       On Error GoTo test_Error
    'Change the following line to the sheet containing the data
    Set dataWs = Worksheets("Sheet9")
    For k = 2 To dataWs.Cells(Rows.Range "B1:I56").End(xlUp).Row
    Set OutApp = CreateObject("Outlook.Application")
    Set OutMail = OutApp.CreateItem(0)
    With OutMail
        .To = dataWs.Range("L4" & k)
        .Subject = "Generic subject"
         ' In place of the following statement, you can use ".Send" to Send the email
        '.Display
         .Send
    End With
    End If
    Set OutMail = Nothing
    Set OutApp = Nothing
    Next
       On Error GoTo 0
       Exit Sub
    test_Error:
        MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure test of  Module1"
    End Sub

    My main goal is to have the participant value as a listbox with all sections filled out in vlookup with a simple macro button to compile and send through the default mail with a standardised subject and filename.

    Really need help with this, happy to contract someone to do the coding if they're interested.
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

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