colinmitton
Technical User
I'm trying to save a document to same folder everytime but prompt the user for a file name. The folder is located on a server and has a UNC path. its part of a bigger macro but the relevent code is below :
Dim filename As String
filename = InputBox("Name for new file?")
If filename <> "" Then
ChDir "\\server\reports\"
With ActiveWorkbook
.SaveAs filename
End With
End If
The code works if I use "z:\server\reports" but I dont want to give out a drive letter as thats going to get too complicated with the different setup I have inherited here!
I'm not sure how to work with this one as my VBA is very limited.
Thanks in Advance.
Dim filename As String
filename = InputBox("Name for new file?")
If filename <> "" Then
ChDir "\\server\reports\"
With ActiveWorkbook
.SaveAs filename
End With
End If
The code works if I use "z:\server\reports" but I dont want to give out a drive letter as thats going to get too complicated with the different setup I have inherited here!
I'm not sure how to work with this one as my VBA is very limited.
Thanks in Advance.