I created a macro and it works perfectly on my computer. However when I share it across the network and try to get it to work on other computers it stops working at when it hits this line of code
The version of excel doesn't matter either. I have tried multiple versions and it literally just skips the above lines of code. I have no idea why but I really need to fix this issue. Any ideas?
Code:
Dim i As Integer
Dim sFileName As String
i = 1
sFileName = MyCell & "-" & i & ".xls"
Application.DisplayAlerts = False
Do
If Dir(sFileName) <> "" Then
i = i + 1
Let sFileName = MyCell & "-" & i & ".xls"
Else
End If
Loop Until Dir(sFileName) = ""
ActiveWorkbook.SaveAs sFileName, _
FileFormat:=xlNormal, _
Password:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False
Dim wbMyWB As Workbook
Dim sXLSName As String
Dim sCSVName As String
Set wbMyWB = ActiveWorkbook
sXLSName = wbMyWB.Name
sCSVName = ActiveWorkbook.Name
Workbooks.Open "\\PC-1\Inbox\Steel Shop Card.xltm"
Workbooks(sCSVName).Close
Exit Sub
The version of excel doesn't matter either. I have tried multiple versions and it literally just skips the above lines of code. I have no idea why but I really need to fix this issue. Any ideas?