what is the correct syntax of SavePath = C:\Users\NEL Yefim\Documents\NEL ?
what is the correct syntax of SavePath = C:\Users\NEL Yefim\Documents\NEL ?
As far as I can ascertain, SavePath is not a VBA property. It seems to belong to MatLab. In VBA it would be a perfectly good name for a variable to hold the path for saving a document.
Every saved document has a name, like, "My Excel Workbook.xlsx". The name consists of the name proper and the "extension". In this example the extension is "xlsx" and the name proper is "My Excel Workbook". The two are separated from each other by a period. In days gone by there couldn't be a period in a name proper. Now the rule is that there can't be one in the extension. The last period in a file name designates whatever follows as the file extension.
Extensions are important because they specify the file type. Applications use them to know if they can handle the type of file indicated by the extension. If you rename our example file as "My Excel Workbook.docx" Word will believe that it is a file it can handle but fail in the attempt. But if you rename it as "My Excel Workbook.csv" Excel can probably still make out what's inside.
Like living persons, files must have an address. Consider an address like "North America\U.S.A\Oregon\Portland\High Street\ 2100\Apt 10C\John Smith". From continent to country to state to city to street to building, the apartment is exactly defined and tells you where to find John Smith. In an PC jargong this is called a path. Observe that I used the backslash to separate the elements. This is part of the computer path syntax.
A path would therefore consist of [Drive]\[Root Folder]\[Sub Folder]\[Sub Sub Folder]\[Sub Sub Sub Folder]. There could be more sub folders, or fewer, in the hierarchy but the path doesn't include the file name. That's where the extension comes in. If there is an extension in the last element's name it's a file name. If there is no extension it's part of the path. The separator between path and file name is a backslash (at least in Windows Operating Systems it is), the same as the between all other components of the path.
Convention has it that the drive letter is succeeded by a colon. The root directory, or root folder, is simply the first folder mentioned in the path that follows the driver letter. The point is that the root folder must be found in the drive, the sub folder must be contained in the root folder, the sub sub in the sub etc. Just as a parcel sent to John Smith wouldn't be able to arrive if there is no "High Street" in Portland or no #2100 in High Street or no Apt 10C at 2100 High Street. even if Portland is found in Oregon and Oregon in the US.
Here is the example of a path written in correct syntax.
C:\Users\John Smith\Desktop
Note that the final backslash isn't part of the path, strictly speaking, nor is it part of the name that would follow the path. It's the separator between path and name. However, in some applications of the path having or not having it makes a difference. For example, in VBA, DIR("C:\Users\John Smith\Desktop") will confirm that the folder exists whereas DIR("C:\Users\John Smith\Desktop\") will return the name of the first file in it. I think this difference belongs to the syntax for the DIR function, not the path.