我已经搜索了一堆主题,但似乎没有任何解决方案对我有用。
我有一个 Excel 宏文件,有时可以正常工作,但有时只能在步进模式下工作。
这是主子程序中的子程序,它按类别(键)将值(消息)从 Outlook 日历传递到电子表格。(对于这段代码,我从Script改编为Outlook 中按日历类别的总小时数)。该值进入与类别和列中的周值同名的行。我已经尝试过 DoEvents 并且我认为它有效,但是当我尝试在另一台计算机上运行它时,它又失败了。
有任何想法吗?
Option Explicit
Public keyArray
Sub totalCategories()
Dim app As New Outlook.Application
Dim namespace As Outlook.namespace
Dim calendar As Outlook.Folder
Dim appt As Outlook.AppointmentItem
Dim apptList As Outlook.Items
Dim apptListFiltered As Outlook.Items
Dim startDate As String
Dim endDate As String
Dim category As String
Dim duration As Integer
Dim outMsg As String
Dim firstDayOfTheYear As Date
'Going to be used to get start and end date …Run Code Online (Sandbox Code Playgroud)