【发布时间】:2017-04-04 06:47:12
【问题描述】:
我在 Access 数据库中有代码。
Private Sub Text0_Click()
Dim s As String
s = MyGetOpenFileName
Me.Text0.Value = s
End Sub
在 Windows 7 Office 2010 中,当我单击打开的文本框时。
在 Windows 10 Office 2013 中没有任何反应。
【问题讨论】:
我在 Access 数据库中有代码。
Private Sub Text0_Click()
Dim s As String
s = MyGetOpenFileName
Me.Text0.Value = s
End Sub
在 Windows 7 Office 2010 中,当我单击打开的文本框时。
在 Windows 10 Office 2013 中没有任何反应。
【问题讨论】:
我认为这应该可行:
将 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)
我显示带有过滤器的窗口以显示 excel 文件,然后检查文件是否被选中,如果为真,然后我打开文件。
【讨论】: