Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50103

Folder picker breaks for Mac

$
0
0
I'm pretty comfortable in a Windows environment, but the excel and macros I made were for a Mac, lovely..
So after fixing almost everything else, I'm completely jammed on this last problem: the folder picker.
I just want the user to be able to pick where to save the file, the program will control the name of the file string.

Here is the code tossing the problem:

Code:

Function GetFolder(strPath As String) As String
Dim sItem As String
Dim sFile As String
Dim fldr As FileDialog
Set fldr = Application.FileDialog(msoFileDialogFolderPicker)

With fldr
    .Title = "Select a Folder"
    .AllowMultiSelect = False
    .InitialFileName = strPath

    If .Show <> -1 Then GoTo NextCode
    sItem = .SelectedItems(1)
End With

NextCode:
GetFolder = sItem
Set fldr = Nothing

sFile = "\" & sSubID & "-" & sSubSession & "-synced.txt"
ActiveWorkbook.SaveAs Filename:=sItem & sFile, FileFormat:=xlTextWindows, CreateBackup:=False
End Function

Another note: I'm going on about hour 4 of using a Mac - ever. So if anyone can help with this problem, please make it a dumbed-down version. Thanks in advance!

Viewing all articles
Browse latest Browse all 50103

Trending Articles