I have the following Event Procedure working well but now I need to skip a column and can't get it to work. I need to skip column E. And I don't want to use the field names and begin on Row 2.
Code:
Private Sub cmd_Import_Wklst_Click()
Dim strPathFile As String, strFile As String, strPath As String
Dim strTable As String
Dim strNewPath As String
Dim strNewPathFile As String
Dim strRange As String
'Dim blnHasFieldNames As Boolean
' Change this next line to False if the first row in EXCEL worksheet does not have column/field names
blnHasFieldNames = True
' shared folder path that contains the EXCEL files
strPath = "\\maindirectory\subdirectory\directory\Folder\FileName\"
strNewPath = "\\maindirectory\subdirectory\directory\Folder
Quality\CompleteWorklists\Downloaded_Into_Access\"
' the database table where the worklists are to be imported
strTable = "import_ready_for_download"
strFile = Dir(strPath & "*.xls")
Do While Len(strFile) > 0
strPathFile = strPath & strFile
strNewPathFile = strNewPath & strFile
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, _
strTable, strPathFile, blnHasFieldNames, "A:O" 'want to change this to A:D then F:O
strFile = Dir()
' Copy file to new location:
FileCopy strPathFile, strNewPathFile
' Delete the EXCEL file(s) after it's been imported Or you comment this Kill command out if you don't want to
Kill strPathFile
Loop
End Sub
Any help is greatly appreciated.