Advertisement
Advertisement
| 07.23.2008 at 10:29AM PDT, ID: 23589405 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: |
Private Sub test_Click()
Dim objXL As Object
Dim sTable As String
Dim xlPath As String
Dim i As Integer
Dim dDate As Date
Dim shtName As String
Dim strFilter As String
Dim strInputFileName As String
strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.XLS)", "*.XLS")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY)
xlPath = strInputFileName
Set objXL = CreateObject("Excel.Application")
objXL.Workbooks.Open xlPath, , True
With objXL
For i = 1 To .Worksheets.Count
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "CSMP Upline", xlPath, True, .Worksheets(i).Name & "!"
Next
End With
objXL.Quit
Set objXL = Nothing
End Sub
|