With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.
Private Sub cmdImport_Click() Dim rec As DAO.Recordset Dim xls As Object Dim xlsSht As Object Dim xlsWrkBk As Object Dim xlsPath As String Dim xlsFile As String Dim fullXlsFile As String Dim fullFile As String Dim Msg, Style, title, Response Msg = "Importing is Done, Files are imported!" ' Define message. Style = vbOKOnly title = "Import Mesage" xlsPath = Me.txtFolder & "\" xlsFile = Dir(xlsPath & "*.xls", vbNormal) ' Retrieve the first entry. Do While xlsFile <> "" ' Ignore the current directory and the encompassing directory. fullXlsFile = xlsPath & xlsFile fullFile = xlsPath & xlsFile If Right(fullXlsFile, 4) = ".xls" Then 'import it DoCmd.SetWarnings False Set xls = CreateObject("Excel.Application") xls.Application.Visible = False xls.Application.displayalerts = False Set xlsWrkBk = GetObject(fullXlsFile) Set xlsSht = xlsWrkBk.Worksheets(1) 'NestSummary 'open table Set rec = CurrentDb.OpenRecordset("tblNestImport") rec.AddNew rec.Fields("NestID") = Nz(StrConv(xlsSht.cells(2, "E"), vbProperCase), "badnestid") rec.Fields("MaterialPartNumber") = Nz(StrConv(xlsSht.cells(5, "N"), vbProperCase), "badmaterialpartnumber") rec.Fields("TotalTime") = xlsSht.WorksheetFunction.Sum("G13:G100") rec.Update DoCmd.SetWarnings True End If 'close excel xlsWrkBk.Application.Quit Set xls = Nothing xlsFile = Dir() Loop Response = MsgBox(Msg, Style, title) End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|Macro to convert table into pivot tables||25||65|
|what is the 64bit version of this window API?||2||21|
|Excel - merge column values||3||19|
|SQL Server and Access Database (Project Codes) get the next record||43||24|
Join the community of 500,000 technology professionals and ask your questions.