We value your feedback.
Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
Private Sub Command3_Click() Dim strFile As String 'Filename Dim strFileList() As String 'File Array Dim intFile As Integer 'File Number Dim filename As String Dim path As String DoCmd.SetWarnings False path = "G:\Store Planning\Projects\Parts Tracker\ToImport\" 'Loop through the folder & build file list strFile = Dir(path & "*.xls") While strFile <> "" 'add files to the list intFile = intFile + 1 ReDim Preserve strFileList(1 To intFile) strFileList(intFile) = strFile strFile = Dir() Wend 'see if any files were found If intFile = 0 Then MsgBox "No files found" End If 'cycle through the list of files For intFile = 1 To UBound(strFileList) filename = path & strFileList(intFile) DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "tmpShipping", filename, True 'Erroring on this line Next intFile DoCmd.SetWarnings True End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.