I am trying to choose a file to open later. This piece of my code used to work until a few days ago and is supposed to show the file dialog box. What happens now is that the dialog box does not show and returns 0 (cancel).
I have MS Office Pro Plus 2010 Excel version 14.07
I use this feature multiple times a day for work, so any help is much appreciated.
Rama
I have MS Office Pro Plus 2010 Excel version 14.07
Code:
Sub debugFileDialog()
Dim fd As FileDialog
Set fd = Nothing
Set fd = Application.FileDialog(msoFileDialogOpen)
If fd Is Nothing Then
MsgBox ("problem with fd in nextStudentFileOpen")
Exit Sub
End If
fd.InitialFileName = localPath
fd.Title = "Select the file"
If fd.Show = 0 Then 'user has cancelled
'do nothing and skip this student
MsgBox ("skipping")
Else
MsgBox ("Processing")
End If 'student processing
Set fd = Nothing
End Sub
Rama
Last edited by a moderator: