Results 1 to 9 of 9

command button 1 (save as pdf named the current time and date . then send by email

Threaded View

  1. #1
    Registered User
    Join Date
    02-27-2013
    Location
    KSA
    MS-Off Ver
    2011 MAC & Mac 2015
    Posts
    54

    command button 1 (save as pdf named the current time and date . then send by email

    hello everyone. this is my first post. and i need your help with the following



    first of all im a beginer in Excel VBA code . no idea what im doing . but i came with the following after long searching



    basically what i want to do is the following : i want to creat a command button and the order for that button is to save the file as pdf . the file name will be the current date and time then the same button have to send the file as attachment to Outlook . im using Excel 2010.

    im using the following code for sending . but it send only excel sheet as excel file:
    Sub SendIt()
    
        Application.Dialogs(xlDialogSendMail).Show arg1:="[email protected]", _
                          arg2:="Handover Shift"
    End Sub
    
    
    Private Sub CommandButton1_Click()
    
    Application.Dialogs(xlDialogSendMail).Show arg1:="[email protected]", _
                          arg2:="Handover Shift"
    End Sub
    
    
    now the save as PDF file . i was able to creat a different button :
    
    Private Sub CommandButton3_Click()
     ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
            "C:\Users\SAFA\Documents\SAFA Dispatch Handover Report " & _
     Format(Now, "dd mmm yy hh mm ") & ".pdf"
     
    End Sub

    can someone help me to combine both order under one button ?


    thank you alot

    i found similar articles here. but it didnt work . i need to copy and paste please.

    thank you

    regards,

    Hani
    Last edited by vlady; 02-27-2013 at 09:57 PM.

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