MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.
Function getXlFile() Dim objXL As Object, xlSht As Object Dim strWSname As String Dim i As Integer, j As Integer Dim sFile, sTable sFile = "\\anetworkshare\test\test.xls" sTable = "Headcount_Import" Set objXL = CreateObject("Excel.Application") objXL.Workbooks.Open sFile, , True With objXL For i = 1 To .worksheets.Count strWSname = .worksheets(i).Name Set xlSht = .activeworkbook.worksheets(i) 'Get header names For j = 1 To xlSht.usedrange.Columns.Count ' Test msg box ' MsgBox xlSht.cells(1, j).Value Next DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, _ "" & sTable & "_" & strWSname & "", sFile, True, "" & strWSname & "!" Next End With objXL.Quit Set objXL = Nothing End Function
|Looking for a program that deletes all files of same size||18||59|
|Auto-generated ID's in MS Access||9||43|
|Data Type Mismatch in Criteria - Access||6||28|
|Access VBA - selected Item in Listbox (multiselect) - value of ONE item selected||4||35|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
14 Experts available now in Live!