killerflappy
Registered User.
- Local time
- Today, 19:07
- Joined
- Aug 23, 2017
- Messages
- 50
Hi,
I have an automated Excel-file import where the user can choose the excel-file with routes to drive.
DoCmd.TransferSpreadsheet acImport, 8, "tblRoutes", selectFileWithoutDoubleCheck(), True, "!A1:L1000"
The headers all aready there in tblRoutes.
Now every day column K1 of the Excel file changes to the name of the day.
So then Access refuses to import.
I tried to set True to False. Still don't work.
Also I change the the range from A1:L1000 ti A2:L1000. Also don't work.
The Excel files to import have different names, so changing the Excel-file from access Is not possible.
The selectFileWithoutDoubleCheck() function is this. Maybe it's possible to use this to change the K1?
Another possible solution would be to avoid the column K from Excel.
I don't see how to do this
I have an automated Excel-file import where the user can choose the excel-file with routes to drive.
DoCmd.TransferSpreadsheet acImport, 8, "tblRoutes", selectFileWithoutDoubleCheck(), True, "!A1:L1000"
The headers all aready there in tblRoutes.
Now every day column K1 of the Excel file changes to the name of the day.
So then Access refuses to import.
I tried to set True to False. Still don't work.
Also I change the the range from A1:L1000 ti A2:L1000. Also don't work.
The Excel files to import have different names, so changing the Excel-file from access Is not possible.
The selectFileWithoutDoubleCheck() function is this. Maybe it's possible to use this to change the K1?
Code:
Function selectFileWithoutDoubleCheck()
Dim fd As FileDialog
Set fd = Application.FileDialog(msoFileDialogFilePicker)
fd.InitialFileName = "Z:"
With fd
If .Show Then
selectFileWithoutDoubleCheck = .SelectedItems(1)
Else
'stop execution if nothing selected
End
End If
End With
Set fd = Nothing
End Function
Another possible solution would be to avoid the column K from Excel.
I don't see how to do this
Last edited: