How to create folder in chosen localization with VBA? For one project I had to create folder. Had to search internet and as always helpful was site stackoverflow.com.
Quite interesting thing might be Chr(34). It allowed to use double-quotes in text message in Msgbox or Debug.Print.
Folder creation in chosen localization with VBA:
Sub FolderCreation() ' Folder creation ' Source: ' https://stackoverflow.com/questions/10803834/is-there-a-way-to-create-a-folder-and-sub-folders-in-excel-vba Dim fso As Object Dim fldrname As String Dim fldrpath As String Dim sItem As String sItem = ThisWorkbook.Path 'path might be chosen via Folder Picker by user Set fso = CreateObject("scripting.filesystemobject") fldrname = "VBA_Folder" fldrpath = sItem & "\" & fldrname If Not fso.folderexists(fldrpath) Then fso.createfolder (fldrpath) Debug.Print "Folder " & Chr(34) & fldrname & Chr(34) & " has been created in localization " & Chr(34) & sItem & Chr(34) & "." Else Debug.Print "Folder " & Chr(34) & fldrname & Chr(34) & " already existed in localization " & Chr(34) & sItem & Chr(34) & "." End If End Sub