【发布时间】:2020-07-13 16:32:21
【问题描述】:
我的问题是关于打开文档文件。 我想让我的用户选择他想要保存文件的位置。 但是,我可能错了,但我使用了 FileDialog (msoFileDialogFolderPicker) 正常打开文件,然后向我发送错误消息!我开始编程谢谢你的帮助。
这是我的代码
Public Function ObtenirCheminFichier(path As String)
Dim fso As Object
Dim filePath As String
Set fso = CreateObject("scripting.filesystemobject")
ObtenirCheminFichier = path
If Not fso.FileExists(path) Then
Dim tmpPath As String
tmpPath = Replace(Replace(path, ".\", "", , 1), "\", "", 1, 0)
'ObtenirCheminFichier = Application.FileDialog(msoFileDialogFolderPicker).Show()
' ObtenirCheminFichier = CurrentProject.path & "\" & tmpPath
ObtenirCheminFichier = Application.FileDialog(msoFileDialogFolderPicker) & "\" & tmpPath
End If
End Function
我怀疑这个错误
DoCmd.OutputTo acOutputQuery, "Categorie_C2_req", acSpreadsheetTypeExcel12, spath, True
【问题讨论】: