Public Sub ImportXL()
Const xlPath As String = "F:\MIS consolidation tool\Source files\Securities_1.xls"
Const xlPathTemp As String = "F:\MIS consolidation tool\Source files\TEMP_Securities_1.xls"
Dim acExcel, wb
Set acExcel = CreateObject("Excel.Application")
acExcel.Visible = False
Set wb = acExcel.Workbooks.Open(xlPath)
wb.Worksheets("Sheet1").Range("A:A,C:E,G:I,K:P").Delete
wb.SaveCopyAs xlPathTemp
wb.Close False
Set wb = Nothing
acExcel.Quit
Set acExcel = Nothing
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel3, _
"TempDoneTrades", xlPathTemp, True
Kill xlPathTemp
End Sub
|