J
Jason
I'm trying to use the code pasted below to browse for a filename. When I
compile the code I get the error:
"Compile Error: Sub or Function not defined." and it highlights
"ahtAddFilterItem" in the code.
Do I need to install a reference library or something to get this to work?
Here is the code:
DoCmd.TransferSpreadsheet acImport, , "xTemp", GetFile(), True
Here is the GetFile function that I copied from the site:
Function GetFile()
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)
End Function
compile the code I get the error:
"Compile Error: Sub or Function not defined." and it highlights
"ahtAddFilterItem" in the code.
Do I need to install a reference library or something to get this to work?
Here is the code:
DoCmd.TransferSpreadsheet acImport, , "xTemp", GetFile(), True
Here is the GetFile function that I copied from the site:
Function GetFile()
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)
End Function