访问VBA GetOpenFileName不起作用

我有一个访问数据库,在Windows 7办公室2010年工作正常,但在Windows 10办公室2013年一个代码是行不通的。

这是有问题的代码。

Private Sub Text0_Click() Dim s As String s = MyGetOpenFileName Me.Text0.Value = s 

结束小组

在Windows 7中,当我点击文本框的窗口打开。 但在Windows 10中,如果我点击没有任何反应。

我认为这应该工作:

昏暗的OpenFile作为工作簿

 fPath = Application.GetOpenFilename(FileFilter:="Excel files, *.xl; *.xlsx; *.xlsm; *.xlsb; *.xlam; *.xltx; *.xls; *.xlt ", Title:="You can type the title for Your window here") If fPath = False Then Exit Sub End If Set OpenedFile = Workbooks.Open(fileName:=fPath, UpdateLinks:=0, IgnoreReadOnlyRecommended:=True) 

我显示的窗口与filter优秀的文件,然后检查是否select文件,如果是的话,我打开文件。