David Montoya
New Member
- Joined
- Apr 25, 2018
- Messages
- 49
Dear,
I have a macro which has been working for long time under Windows 7 and Office 2010; however, when migrating to Windows 10 and Office 2016, it stops working. I am wondering if the forum can assist me to identify the problem.
The first part deals with the execution at opening the workbook:
The second part is the actual macro, which deal with the daily run schedule:
By the way, the procedure “Append_and_PDFs" works fine if I execute it manually. I have tested the macro under the old environment, and it executes with no problem, but it does not run under the new environment. User names have not changed either.
Thank you!
I have a macro which has been working for long time under Windows 7 and Office 2010; however, when migrating to Windows 10 and Office 2016, it stops working. I am wondering if the forum can assist me to identify the problem.
The first part deals with the execution at opening the workbook:
Code:
Private Sub Workbook_Open()
Application.ScreenUpdating = False
RunSchedule
Application.DisplayAlerts = True
End Sub
The second part is the actual macro, which deal with the daily run schedule:
Code:
Sub RunSchedule()
If Environ$("username") = "abcdef" Then
Application.OnTime TimeValue("16:30:00"), "Append_and_PDFs"
ElseIf Environ$("username") = "ghijkl" Then
Application.OnTime TimeValue("16:35:00"), "Append_and_PDFs"
ElseIf Environ$("username") = "mnopqr" Then
Application.OnTime TimeValue("16:40:00"), "Append_and_PDFs"
End If
End Sub
By the way, the procedure “Append_and_PDFs" works fine if I execute it manually. I have tested the macro under the old environment, and it executes with no problem, but it does not run under the new environment. User names have not changed either.
Thank you!