Hi all,
We are in the process of moving our on premise file shares into SharePoint 365.
We have a number of access databases which import data from csv files and have therefore been testing that the import function will still work as it does currently.
We are using Application.FileDialog along with the DoCmd.TransferText functions to search for the the file and import it.
We are also using a third party tool to map drives to various document libraries on SharePoint.
However, each time we run the code we are getting the error that we cannot import an html file. I have set the FileDialog . InitialName to the mapped drive F:\ and I have even hardcoded the file path and file into DoCmd.TransferText, but each time we get the import error.
I'm fearing that this is another one of those SharePoint\Access limitations!
The code I am currently using is listed below and any suggestions would be much appreciated.
Thank you
Paul
Code:
Dim fd As FileDialog
Dim fileName As String
Set fd = Application.FileDialog(msoFileDialogOpen)
With fd
'Existing filters must be cleared before adding new:
.Filters.Clear
.Filters.Add "Text Files", "*.csv"
'InitialFileName can be used to set initial directory for file dialog:
.InitialFileName = "F:\"
End With
fd.Show 'Show file select dialog
fileName = fd.SelectedItems(1)
DoCmd.TransferText acImportDelim, "PagesCreatedSpec", "Pages_Created", fileName, True