C
carl
Hi Ron et al...
Just to refresh - from Excel, I am trying to run a macro
which will email the body of the active worksheet.
I set the reference in the VB Editor as instructed on the
website.
Then I opened a new module and pasted your macro (which I
slightly modded - email address / subject) into it.
The code got hung up at: .HTMLBody = SheetToHTML
(ActiveSheet)
The macro I pasted:
Sub Mail_ActiveSheet_Body()
Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = "(e-mail address removed)"
.CC = ""
.BCC = ""
.Subject = "Test"
.HTMLBody = SheetToHTML(ActiveSheet)
.Send 'or use .Display
End With
Application.ScreenUpdating = True
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Thanks for your assistance - it is much appreciated.
Just to refresh - from Excel, I am trying to run a macro
which will email the body of the active worksheet.
I set the reference in the VB Editor as instructed on the
website.
Then I opened a new module and pasted your macro (which I
slightly modded - email address / subject) into it.
The code got hung up at: .HTMLBody = SheetToHTML
(ActiveSheet)
The macro I pasted:
Sub Mail_ActiveSheet_Body()
Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = "(e-mail address removed)"
.CC = ""
.BCC = ""
.Subject = "Test"
.HTMLBody = SheetToHTML(ActiveSheet)
.Send 'or use .Display
End With
Application.ScreenUpdating = True
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Thanks for your assistance - it is much appreciated.