This code lets the user select multiple files to open. That last line works okay on my PC, but my remote user tells me that on his Mac it gives an error Run-Time error 91: Object variable or block variable not set
Sub OpenSeveralFiles()
Dim fd As FileDialog
Dim FileChosen As Integer
Dim fileName As String
Dim i As Integer
Set fd = Application.FileDialog(msoFileDialogFilePicker)
fd.InitialView = msoFileDialogViewList
It's odd because I'd expect that error to occur at the Set
line.
Could it have something to do with the fact that I don't specify a directory path? In Windows VBA it defaults to a CurDir
, but I don't know what happens on a Mac.