title: How to Fix Compile Error for Excel VBA in Windows 10?
body: <p>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.</p>
  
  <p>I tried rebuilding the file in a Windows 10 PC but is still getting the same error. Below is the script I'm using.</p>
  
  <pre><code>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&amp;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 &lt;&gt; 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
  </code></pre>
  
  <p>The report is supposed to run the "Real-Time\Designer\Rock: Split/Skill Report w/ Backup&amp;OCC{}" report in CMS and paste the extracted value in the excel file.</p>