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.
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.