我有一个连接到多个团队工作簿的主工作簿,可以将大量数据链接在一起。基本上,我使用数据库样式的仪表板列表及其关键字(负责仪表板的员工),仪表板短名称,仪表板完整路径和仪表板密码。
我希望员工能够手动更改密码,然后通过主工作簿上的快速宏更新密码。
这一切都运行得相当不错,但是如果在尝试运行代码时提供的密码不正确,则会出现打开工作簿的输入密码提示。如果你点击取消,它会运行它应该如何,但它不方便,有点混乱。有没有办法让我停止提示?它出现在set wbDash = workbooks.open
....行:
'Make sure password is correct
If PWChange = True Then 'PWChange:=Boolean
On Error Resume Next
Application.DisplayAlerts = False
Set wbDash = Workbooks.Open(FileName:=(DashLocBox.Value + DashNameBox.Value + ".xlsm"), password:=PW1Box.Value)
Application.DisplayAlerts = True
If Err.Number = 1004 Then
MsgBox "You have supplied an incorrect password. You cannot update the workbook with an incorrect password."
Exit Sub
ElseIf Err.Number <> 0 Then
MsgBox "An unexpected error has occurred. Aborting..." & vbCrLf & vbCrLf _
& "Err " & Err.Number & ";" & Err.Description
Exit Sub
End If
wbDash.Close
Err.Clear
On Error GoTo 0
End If
答案 0 :(得分:1)
task.getJobList().stream()
.collect(
groupingBy(
Job::getAgentId,
collectingAndThen(toList(), jobs -> new Task(id, jobs))));