Hi Stan
This code will pass the default file path of the users machine:
Sub TryThis()
Dim FilePath As String
FilePath = Application.DefaultFilePath
MsgBox FilePath
End Sub
Dave
OzGrid Business Applications
I saw that in the VB online help. Only problem with that is it can be changed by the user. We are going to using NTFS permissions to stop users from getting into the other people's directories. If user changes it he could lock himself out form his own directory. The home directory is going to be set by a login script from the NT server. I would like to be able to set the path with a generic path at the beginning (I.E. t:\sales\quotes\xxxxx) With xxxx being the users login name. I can pull the login name into Excel and I just can't figure out to set a path name using the xxxx variable and the variable that I have setup for the file name.
Thanks for your previous reply.
You mean like:
Application.DefaultFilePath = "t:\sales\quotes\" & xxxxx
Dave
OzGrid Business Applications
I tried that and it works, only problem I believe is if you save the spreadsheet somewhere else and then use the macro to save the file it will default to where you last saved the file, not the default path. I would like to force the path every time they use the macro to save the file in a specific location.
Thanks for your help
Try placing:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Cancel = False
Me.SaveAs "t:\sales\quotes\" & xxxxx
Cancel = True
End Sub
In the module of "ThisworkBook"
Dave
OzGrid Business Applications