Power Query Course in Spanish
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: Emailing A Workbook As An Attachment

  1. #1
    Board Regular
    Join Date
    Mar 2002
    Posts
    85
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi, I have recently made an invoice template for my freight forwarding company and I would like to send it as workbook attachment on an E-mail using MS outlook when I click a button, however this is the tricky part on this invoice template I have buttons I woukld like to have the Invoice saved as an attachment without the buttons if it helps my invoice is on the following cells A1 to G49

    Can someone help me please I really need to find out how to do this very quickly and don't have time to learn visual basic!

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Posts
    85
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    please?

  3. #3
    Board Regular
    Join Date
    Mar 2002
    Posts
    85
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I need this

  4. #4
    Board Regular
    Join Date
    Feb 2002
    Location
    Leicestershire, U K
    Posts
    160
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Try this

    Sub sendsheet1()
    'Declare String
    Dim sAddress As String
    'Initialise the string with the address entered into box
    sAddress = InputBox("Please enter the name of the recipient" & vbCr & "CONVENTION = firstname . surname@thiscompany.co.uk", "Send To")

    'If the user doesn't enter an address then exit the sub.
    If sAddress = "" Then Exit Sub
    ' SELECT THE SHEET NAME
    Sheets("site 1").Select ' change name
    Range(Range("A1"), Range("g49").End(xlUp)).Select
    Selection.Copy
    ' if you have multi formatted colums etc ( ie various widths etc) then it is better to create a blank master and load that and then paste to that
    Workbooks.Add
    ' paste the selection
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
    False, Transpose:=False
    Application.CutCopyMode = False
    ActiveWorkbook.SendMail Recipients:=sAddress, Subject:="site 1 cost pro", ReturnReceipt:=False
    MsgBox "Your email has been sent to" & vbCr & sAddress & vbCr & "", , "MESSAGE"
    ActiveWindow.Close
    ' at this point select no to msgbox and then swithback to original sheet
    Sheets("printing").Select ' change name
    Range("A1").Select
    End Sub


    [ This Message was edited by: keithkemble on 2002-03-12 13:24 ]

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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