File Save As macro for users with different paths

I

iperlovsky

Below I have a sub routine that needs to be modified to enable multiple users
with different paths to the same file location on a network drive to save the
file using this macro. The only difference in location is the letter of the
drive. On my computer it is identified as "N:", but on another user's
computer it could be identified as any letter of the alphabet. Any simple
solutions to this issue?

Sub saveNew()
yyyy = Format(Range("M1").Value, "yyyy")
mmddyyyy = Format(Range("M1").Value, "mm-dd-yyyy")
mmddyy = Range("M2").Value

ActiveWorkbook.SaveAs Filename:="N:\FOLDER\FOLDER 2\folder 3\" & yyyy & "\"
& mmddyyyy & " Distribution" & "\Rates " & mmddyy & ".xls"

End Sub
 
J

Jacob Skaria

Check if path exists and if not provide a browse option to pick the folder..

With Application.FileDialog(msoFileDialogFolderPicker)
.AllowMultiSelect = False
.InitialFileName = "N:\"
.Show
strFolder = .SelectedItems(1)
End With

If this post helps click Yes
 
J

Jacob Skaria

Hey!! Why dont you try the UNC path instead of the mapped drive...If you are
not sure check out with your network administrator...which would be same for
all users within the network.

\\servername\volumename\share\folder\

If this post helps click Yes
 
I

iperlovsky

what does UNC stand for?

Jacob Skaria said:
Hey!! Why dont you try the UNC path instead of the mapped drive...If you are
not sure check out with your network administrator...which would be same for
all users within the network.

\\servername\volumename\share\folder\

If this post helps click Yes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top