0

We just recently switch from Windows 7 to Windows 10 and one of the macros in our file is not working. I've been getting Compile Error: Sub or Function not defined for a "Call doRep" line.

I tried rebuilding the file in a Windows 10 PC but is still getting the same error. Below is the script I'm using.

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

The report is supposed to run the "Real-Time\Designer\Rock: Split/Skill Report w/ Backup&OCC{}" report in CMS and paste the extracted value in the excel file.

Pᴇʜ
  • 56,719
  • 10
  • 49
  • 73
  • it looks like the module that was supposed to hold the sub 'doRep' is not present in the workbook. When you right click on doRep and then 'Definition' does the editor take you to the doRep definition? – SNicolaou Nov 06 '19 at 07:34
  • Just my view/guess, while the issue might be related to the change from win7 to win10, don't think it has to do anything with the OS environment itself. – SNicolaou Nov 06 '19 at 07:36
  • On a side note - looks like your error handler is within the main body of the code? You should have an `Exit Sub` before the error handler, and `End Sub` after it. – Darren Bartrup-Cook Nov 06 '19 at 07:53
  • The sub 'doREP' is also within the same workbook. I'll try and work on the error handler. – Rj Melecia Nov 06 '19 at 09:18
  • @DarrenBartrup-Cook i removed the error handler and it gave me a run-time error '-2147319783 (80028019)'. It says Automation Error. Old format or invalid type library. – Rj Melecia Nov 06 '19 at 10:12

0 Answers0