I am using the code below to remove paths in Excel referencing add-ins for files shared by users. It works with some files, but using it with a new file and receiving a Runtime error 6 overflow error upon opening. It is stopping on the Cell Replace line.
Private Sub Workbook_Open()
Dim i As Long
Dim strWorksheetName As String
strWorksheetName = ActiveSheet.Name
Application.DisplayAlerts = False
For i = 1 To Sheets.Count
Sheets(i).Activate
If Sheets(i).Type = xlWorksheet Then
Cells.Replace What:="'c:\*xla*'!", Replacement:="", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
End If
Next i
Application.DisplayAlerts = True
Sheets(strWorksheetName).Activate
End Sub