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
Bookmarks