excelvbamacos

Is there a Mac/PC variant of Application.GetOpenFilename?


Is there a universal OS variant of this? I am looking to have this code work on a Mac and PC, but this seems only to work on a PC.

strFile = Application.GetOpenFilename("Text Files (.csv),.csv", , "Please selec text file...")

Solution

  • It works in MAC (Excel 2011) As well. See screen shot

    enter image description here

    FOLLOWUP Upon discussion in chat as I suspected the error was not with Application.GetSaveAsFilename but something else. In this case it was Application.GetOpenFilename

    Now Application.GetOpenFilename definitely gives a problem in Mac. I would recommend seeing this thread which also addresses your problem.

    Error when closing an opened workbook in VBA Userform