mykulpasskwa
Board Regular
- Joined
- Mar 20, 2018
- Messages
- 66
Hi there. I've been googling all morning trying to figure this out, and I've looked at the MS help among other forums but no luck.
I want to save a workbook to a specific network path and also save it under a filename with the variable ID and " - Account Overview" (e.g. "012345678 - Account Overview"). I have a command button the user can click, but I also have a worksheet calculate set up to prompt the user if they want to save if two values match. The idea is that the user has a chance to save if they forget to after filling in the sheet (happens a lot), but also that it saves to a place others can access it later on. I still want to give them the choice to change the location with the SaveAs dialogue box, but in most cases they'll save to our shared location.
I have either (1) been able to open the SaveAs dialogue box where the File Name is blank or (2) the file name is filled out correctly but the path doesn't open to the shared drive, but I haven't been able to save to the share drive with file name I want. For what it's worth I've checked the pathname multiple times to make sure its correct. The code below goes to the path but the File Name is blank. Anyone have any ideas what's wrong?
I want to save a workbook to a specific network path and also save it under a filename with the variable ID and " - Account Overview" (e.g. "012345678 - Account Overview"). I have a command button the user can click, but I also have a worksheet calculate set up to prompt the user if they want to save if two values match. The idea is that the user has a chance to save if they forget to after filling in the sheet (happens a lot), but also that it saves to a place others can access it later on. I still want to give them the choice to change the location with the SaveAs dialogue box, but in most cases they'll save to our shared location.
I have either (1) been able to open the SaveAs dialogue box where the File Name is blank or (2) the file name is filled out correctly but the path doesn't open to the shared drive, but I haven't been able to save to the share drive with file name I want. For what it's worth I've checked the pathname multiple times to make sure its correct. The code below goes to the path but the File Name is blank. Anyone have any ideas what's wrong?
VBA Code:
Public Sub cbSave_Click()
Dim FName As String
Dim ID As Variant
ID = ActiveSheet.Range("ShID").Value
FName = Application.GetSaveAsFilename("\\server\folder\" & ID & " - Account Overview")
End Sub