P
PatK
Ok...I officially give up. I must be missing something so am asking if anyone
sees my bug here. When I get to the Docmd.TransferSpreadsheet, I get a 3011
error, saying the Jet database engine could not find object (the "Asset-Info"
worksheet). What am I missing here? The worksheet definitely exists and the
MsgBox's I have show me it is passing exactly what I want to the
transferspreadsheet command. Ideas?
Private Sub ImportExcel()
Dim sFname As String
Dim sWSheet As String
Dim sTable As String
Dim lngFlags As Long
Dim sFilter As String
sFilter = AddFilterItem(sFilter, "Excel Files (*.XLS)", "*.XLS")
sFname = CommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY)
sWSheet = "Asset-Info"
sTable = "tblAssetUpdate"
MsgBox sFname
MsgBox sWSheet
MsgBox sTable
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, sTable, _
sFname, True, sWSheet <<---this seems to be the problem
End Sub
sees my bug here. When I get to the Docmd.TransferSpreadsheet, I get a 3011
error, saying the Jet database engine could not find object (the "Asset-Info"
worksheet). What am I missing here? The worksheet definitely exists and the
MsgBox's I have show me it is passing exactly what I want to the
transferspreadsheet command. Ideas?
Private Sub ImportExcel()
Dim sFname As String
Dim sWSheet As String
Dim sTable As String
Dim lngFlags As Long
Dim sFilter As String
sFilter = AddFilterItem(sFilter, "Excel Files (*.XLS)", "*.XLS")
sFname = CommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY)
sWSheet = "Asset-Info"
sTable = "tblAssetUpdate"
MsgBox sFname
MsgBox sWSheet
MsgBox sTable
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, sTable, _
sFname, True, sWSheet <<---this seems to be the problem
End Sub