email worksheet

JOEE1979

Active Member
Joined
Dec 18, 2022
Messages
292
Office Version
  1. 365
Platform
  1. Windows
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


Untitled.png


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
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
It looks like the issue relates to saving the workbook in the code (ActiveWorkbook.SaveAs). The template file (if you are using one) must have some old Excel 4.0 formulas in it that don't allow you to save the file as a non-macro XLSX file. I'm not sure if you would want to start saving the files in XLSM format or if you want to do some internet searching on the issue to try to find/update/eliminate the functions to allow saving.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top