我们最近刚刚从 Windows 7 切换到 Windows 10,并且我们文件中的一个宏不起作用。我一直收到编译错误:未为“调用 doRep”行定义子或函数。
我尝试在 Windows 10 PC 中重建文件,但仍然遇到相同的错误。下面是我正在使用的脚本。
Dim cvsApp As New ACSUP.cvsApplication
'Dim cvsConn As New ACSCN.cvsConnection
Dim cvsSrv As New ACSUPSRV.cvsServer
Dim Rep As New ACSREP.cvsReport
Dim Info As Object, Log As Object, B As Object
Dim logged As Boolean
Dim sk As String
Public Sub CMSUPDATE()
If ThisWorkbook.Sheets("CMS").Range("L1").Value = "" Then
MsgBox ("Please Type Skills to update Tool =/")
Else
On Error GoTo e:
Application.ScreenUpdating = True
Application.ScreenUpdating = False
If (ActiveSheet.Name = "Handoff Log 4" Or ActiveSheet.Name = "Handoff Log 3") Then
sk = ThisWorkbook.Sheets(ActiveSheet.Name).Range("F1").Value
Else
sk = ThisWorkbook.Sheets("CMS").Range("M1").Value
End If
ThisWorkbook.Sheets("CMS").Range("E2:Q21").ClearContents
Set cvsSrv = cvsApp.Servers(1)
Call doRep("Real-Time\Designer\Rock: Split/Skill Report w/ Backup&OCC{}", sk)
ThisWorkbook.Sheets("CMS").Range("E2").PasteSpecial
ThisWorkbook.Sheets("CMS").Range("A2:C21").ClearContents
Set cvsSrv = cvsApp.Servers(1)
Call doRep("Real-Time\Designer\RTA-GUA-AVTIME", sk)
ThisWorkbook.Sheets("CMS").Range("A2").PasteSpecial
logout
Application.ScreenUpdating = True
If UCase(Environ("UserName")) = "RMelecia" Then
Range("$A$22").FormulaR1C1 = "RM"
Else
Range("$A$22").FormulaR1C1 = Mid(UCase(Environ("UserName")), 1, 2)
End If
e:
If Err.Number <> 91 Then
MsgBox "Make sure you are logged in CMS. Relaunch CMS and this file if you are still getting this error."
End If
End If
End Sub
该报告应该在 CMS 中运行“Real-Time\Designer\Rock:Split/Skill Report w/Backup&OCC{}”报告,并将提取的值粘贴到 excel 文件中。