sorry if posted in wrong place ive serched around and tryied various options but to no avail.
i need to save a file accrossthe local network. i have set it up as a macro and works fine if saving on the same computer as the file was set up. i then copyied and changed the code to try make it save to a shared folder on another pc... failed... mapped the drive and tried it that way ... failed.
its my first time really using VB/VBA so please be kind
i need to save a file accrossthe local network. i have set it up as a macro and works fine if saving on the same computer as the file was set up. i then copyied and changed the code to try make it save to a shared folder on another pc... failed... mapped the drive and tried it that way ... failed.
its my first time really using VB/VBA so please be kind
Code:
Sub Saveoffice()
'Saves filename as Boat name plus customer and the date due in Dock
Dim newFile As String, fName As String, fName1 As String, fName2 As String
' Don't use "/" in date, invalid syntax
fName = Range("B3").Value
fName1 = Range("B4").Value
fName2 = Range("H9").Value
'Change the date format to whatever you'd like, but make sure it's in quotes
newFile = fName & " " & fName1 & " " & Format$(fName2, "dd-mm-yyyy")
' Change directory to suit your PC, including USER NAME
ChDrive "Z:\"
ChDir "Z:\test"
ActiveWorkbook.SaveAs Filename:=newFile
End Sub