Forum Discussion
Excel
Jun 30, 2021Iron Contributor
To prevent file path in Excel VBA
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...
- Jun 30, 2021
Without 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.
Excel
Jun 30, 2021Iron Contributor
Thank you so much sir😊😊
It helped
It helped
NikolinoDE
Jun 30, 2021Gold Contributor
yw