Jmoz092
Board Regular
- Joined
- Sep 8, 2017
- Messages
- 184
- Office Version
- 365
- 2011
- Platform
- Windows
- MacOS
Hi, I'm getting an error when calling a SaveAs sub at the end of another macro. The save as is not executing, but I've had success using a similar code before. Is there anything obvious wrong with how the code is written? I've made sure that the network files path names are correct in the code and on the network.
Thanks.
Thanks.
Code:
Sub saveas()
Dim thisfile As String
Dim FilePth As String
' For Mac
If Application.PathSeparator = ":" Then
FilePth = "data:Administration:Cath_Lab:" & Range("S2").Value & ":"
thisfile = Range("R2").Value
ThisWorkbook.saveas FilePth & thisfile, FileFormat:=53
Else
' For Windows
FilePth = "data\Administration\CATH_LAB\" & Range("S2").Value & "\"
thisfile = Range("R2").Value
ThisWorkbook.saveas FilePth & thisfile, FileFormat:=52
End If
End Sub