F
fishqqq
I have the procedure below that works great and i would like to have
it run a macro at the end but don't know how to write this. Can anyone
assist?
the macro name is : mShan.openSHANWKST
------------------------------------------
Private Sub Command448_Click()
Dim strPathFile As String, strFile As String, strPath As String
Dim strTable As String
Dim blnHasFieldNames As Boolean
' Change this next line to True if the first row in EXCEL
worksheet
' has field names
blnHasFieldNames = True
' Replace C:\Documents\ with the real path to the folder that
' contains the EXCEL files
strPath = "C:\FMS\SHAN\"
' Replace tablename with the real name of the table into which
' the data are to be imported
strTable = "tSHANSHPTDETAILDOWNLOAD"
strFile = Dir(strPath & "*.xls")
Do While Len(strFile) > 0
strPathFile = strPath & strFile
DoCmd.TransferSpreadsheet acImport,
acSpreadsheetTypeExcel9, _
strTable, strPathFile, blnHasFieldNames
' Uncomment out the next code step if you want to delete the
' EXCEL file after it's been imported
Kill strPathFile
strFile = Dir()
Loop
End Sub
it run a macro at the end but don't know how to write this. Can anyone
assist?
the macro name is : mShan.openSHANWKST
------------------------------------------
Private Sub Command448_Click()
Dim strPathFile As String, strFile As String, strPath As String
Dim strTable As String
Dim blnHasFieldNames As Boolean
' Change this next line to True if the first row in EXCEL
worksheet
' has field names
blnHasFieldNames = True
' Replace C:\Documents\ with the real path to the folder that
' contains the EXCEL files
strPath = "C:\FMS\SHAN\"
' Replace tablename with the real name of the table into which
' the data are to be imported
strTable = "tSHANSHPTDETAILDOWNLOAD"
strFile = Dir(strPath & "*.xls")
Do While Len(strFile) > 0
strPathFile = strPath & strFile
DoCmd.TransferSpreadsheet acImport,
acSpreadsheetTypeExcel9, _
strTable, strPathFile, blnHasFieldNames
' Uncomment out the next code step if you want to delete the
' EXCEL file after it's been imported
Kill strPathFile
strFile = Dir()
Loop
End Sub