Hello, I'm trying to send a worksheet by email.
I have a macro that I been using it for about a year now.
all of a sudden, it now gives me a message when I want to send the email.
When I click "yes" it opens up an email dialogue for me.
Not sure why this is now happening, what do I need to change so it cancels the popup box?
Thank you
this is the macro I have been using
Sub sendemail_West() 'West stores
Dim objmail As Object
Dim sName As String
Dim fName As String
Sheet12.Copy 'Fit the sheet name
sName = Sheet12.Range("A15").Text + "_parts_Request.xlsx" 'Fit the file name
fName = ThisWorkbook.Path & Application.PathSeparator & sName
ActiveWorkbook.SaveAs fName
ActiveWorkbook.Close False
Set objmail = CreateObject("Outlook.Application").CreateItem(0)
objmail.TO = "" 'Fit the eMail
objmail.Cc = "" 'Fit the eMail
objmail.Subject = Sheet12.Range("A15").Text
objmail.Attachments.Add fName
objmail.Display
End Sub
I have a macro that I been using it for about a year now.
all of a sudden, it now gives me a message when I want to send the email.
When I click "yes" it opens up an email dialogue for me.
Not sure why this is now happening, what do I need to change so it cancels the popup box?
Thank you
this is the macro I have been using
Sub sendemail_West() 'West stores
Dim objmail As Object
Dim sName As String
Dim fName As String
Sheet12.Copy 'Fit the sheet name
sName = Sheet12.Range("A15").Text + "_parts_Request.xlsx" 'Fit the file name
fName = ThisWorkbook.Path & Application.PathSeparator & sName
ActiveWorkbook.SaveAs fName
ActiveWorkbook.Close False
Set objmail = CreateObject("Outlook.Application").CreateItem(0)
objmail.TO = "" 'Fit the eMail
objmail.Cc = "" 'Fit the eMail
objmail.Subject = Sheet12.Range("A15").Text
objmail.Attachments.Add fName
objmail.Display
End Sub