PDA

View Full Version : Excel eMail sending failure in Windows 10



simora
04-14-2017, 04:44 AM
I have a vba macro that works correctly in Win 7 & Vista, but it fails to send the email in Windows 10.

If I step through the macro, it fails at Line 81, Col 14 where it says

.Send

ITS THIS BIT:



"This is a auto generated email, please do not reply."
.AddAttachment "c:\Temp1\" & Sheets("Sheet1").Range("AX1").Text & " " & " A Closing Sheet" & ".xls"
.Send



Can anyone tell why this is now failing and if there's a usable workaround that may NOT involve using Outlook.
Attached is the .xls workbook.
Its saved like this as the same format across different versions of Excel to accommodate everyone.

Thanks

Logit
04-14-2017, 02:16 PM
.
First step: make certain the path in your code actually exists on your computer. Is everything spelled correctly ?

Second step, change this:



"This is a auto generated email, please do not reply."
.AddAttachment "c:\Temp1\" & Sheets("Sheet1").Range("AX1").VALUE & " " & " A Closing Sheet" & ".xls" '<<<--- Change Text to Value
.Send




Cell data is referred to as VALUE ... a TEXTBOX data is referred to as TEXT.

simora
04-16-2017, 09:31 AM
Thanks Logit: (http://www.vbaexpress.com/forum/member.php?61536-Logit)

I restarted the Window 10 system and it just worked,no changes; however, none of the Windows 8.1 systems work.
This code has been functioning as is for a couple of years. I'm Still stumped.

Logit
04-16-2017, 09:51 AM
You are welcome.