Hello,
I found this VBA online, but I have some troubles with it.
When mailing worksheet, there is no problems, but the received file is empty, like there is no data in the sheets. Can someone help me with this matter?
I found this VBA online, but I have some troubles with it.
When mailing worksheet, there is no problems, but the received file is empty, like there is no data in the sheets. Can someone help me with this matter?
VBA Code:
Sub Mail()
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = "mymail@domain.com"
.CC = ""
.BCC = ""
.Subject = Range("J16").Value & " TOLDBEREGNING"
.body = ""
.Attachments.Add ActiveWorkbook.FullName
.send
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub