Jun 30 2021 12:49 AM - edited Jun 30 2021 01:05 AM
Hello Everyone,
By using save as dialog box, how to prevent user to change the location path with the help of VBA?
My Computer location path is -
E:\PowerPoint
Please help..???
Here is a attached file...
Jun 30 2021 02:57 AM
SolutionWithout VBA:
The general storage location can be set in Excel under File / Options / Save (Excel 2016).
With VBA:
Sub Nikolinos_autoSave()
Dim Name
Name = Application.GetSaveAsFilename("\\MyOwn_nas01\home\Drive\NikolinosPrivatDuc\MUELL\" & Range("B2") & ".xlsm", fileFilter:="Microsoft Excel-Arbeitsmappe (*.xlsm), *.xlsm")
'In GetSaveFilename you have to enter your file path, be careful with the backschlash where it occurs
If Name <> False Then
ActiveWorkbook.SaveAs Name, FileFormat:= _
xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
End If
'Range("B2") In this cell you can enter the name of the file
End Sub
Finally, your file has also been set up as required :)).
Your file, as understandable, could not be tested for the specified path.
I would be happy to know if I could help.
Nikolino
I know I don't know anything (Socrates)
* Kindly Mark and Vote this reply if it helps please, as it will be beneficial to more Community members reading here.
Jun 30 2021 08:18 AM
Jun 30 2021 02:57 AM
SolutionWithout VBA:
The general storage location can be set in Excel under File / Options / Save (Excel 2016).
With VBA:
Sub Nikolinos_autoSave()
Dim Name
Name = Application.GetSaveAsFilename("\\MyOwn_nas01\home\Drive\NikolinosPrivatDuc\MUELL\" & Range("B2") & ".xlsm", fileFilter:="Microsoft Excel-Arbeitsmappe (*.xlsm), *.xlsm")
'In GetSaveFilename you have to enter your file path, be careful with the backschlash where it occurs
If Name <> False Then
ActiveWorkbook.SaveAs Name, FileFormat:= _
xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
End If
'Range("B2") In this cell you can enter the name of the file
End Sub
Finally, your file has also been set up as required :)).
Your file, as understandable, could not be tested for the specified path.
I would be happy to know if I could help.
Nikolino
I know I don't know anything (Socrates)
* Kindly Mark and Vote this reply if it helps please, as it will be beneficial to more Community members reading here.