VBA To Send Email Not Working Since Windows 10 Update

nc_waggoner

New Member
Joined
Sep 2, 2016
Messages
21
Good morning,

Since upgrading to Windows 10 from Windows 7, my automated reports are not working. They run via Task Scheduler that simply opens the workbooks which call the associated Macros upon opening using the Workbook_Open option. They used to open, run, copy a range of cells, send an Email via Outlook, and close perfectly. Since our Windows 10 "Upgrade" these have stopped working and always crap out on the ActiveWorkbook.EnvelopeVisible = True portion of the macro. Even more odd is that it works perfectly if run manually outside of Task Scheduler. Please see the macro we use:


Address = Range("Ah4")
Addcc = Range("Ah5")
Subject = Range("Ah6")
ActiveSheet.Range("b1:r50").Select
ActiveWorkbook.EnvelopeVisible = True
With ActiveSheet.MailEnvelope
.Item.To = Address
.Item.CC = addcc
.Item.Subject = Subject
.Item.Send
' .Attachments.Add ActiveWorkbook.FullName
End With

Does anyone know why this happens? We figured out that you need to put the exact file path to Excel prior to the file name on the basic task (something Win7 did not require) and this got it to open the Excel file and trigger the macro...just always stops at this line of code. Outlook is always open per usual. The only thing I can think of is that the bits are different, we run x32 for Office and I believe Windows 10 is set for x64.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
did you ever figure this out? i am running into the same issue and also running on 32.
Thanks in advance!
 
Upvote 0
actually ran it on a 64 bit version and it worked!
Hi,
I am running this on windows 10. I am able to run the scheduled job in task scheduler if I select option "run while logged in". But when I select option "run while logged in or not", it runs the whole macro except the email sending functionality.
Could you suggest what did you do to make it run?

I would really appreciate your help.
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,207
Members
452,618
Latest member
Tam84

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