如何修复Windows 10中Excel VBA的编译错误?

我们最近刚从Windows 7切换到Windows 10,并且文件中的宏之一不起作用。我一直在获取编译错误:“ Call doRep”行未定义Sub或Function。

我尝试在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中运行“实时\ Designer \ Rock:带有Backup&OCC {}的分组/技能报告”报告,并将提取的值粘贴到excel文件中。

shuishuiwoai 回答:如何修复Windows 10中Excel VBA的编译错误?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3154238.html

大家都在问