Skip to main content

Posts

Showing posts with the label vba

Send email from excel

Hi All, As we all play around a lot with Excel in our Day to Day tasks, so automating that is a must thing. Below is a code to send the whole excel sheet via email on the click of a button, I know you can find this on various other sites as well, but I am also sharing the same as well. Below is the Macro to send a excel file as a attachment. Sub Send_email() Dim wb As Workbook Dim I As Long Set wb = ActiveWorkbook     If Val(Application.Version) >= 12 Then         If wb.FileFormat = 51 And wb.HasVBProject = True Then             MsgBox "There is VBA code in this xlsx file, there will be no VBA code in the file you send." & vbNewLine & _                    "Save the file first as xlsm and then try the macro again.", vbInformation             Exit Sub         End If  ...