Object Required Error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I thought it would be cleaner and easier to declare the import file path and
then use it in TransferSpreadsheet as shown below. The DoCmd will be
repeated many times - the only thing changing will be the file name.

I'm getting an "object required" error - help?


Dim FilePath As String
Set FilePath = "\\oprdgv1\depart\Finance\_Budget\2007\ePlanning Loads\2007
2007 Forecasts\"

'Import Current Year (CY) data from Excel
DoCmd.TransferSpreadsheet acImport, 8, FilePath &
"CTS_700_HPP_Eplanning_Load.xls", True, _
"Financial_BU1!E6:Z20000"
 
You're missing the name of the table: it goes after the 8, before the path
to the spreadsheet.

BTW, you don't need the Set keyword when you're setting variables.
 
Thanks for the help!!

Douglas J. Steele said:
You're missing the name of the table: it goes after the 8, before the path
to the spreadsheet.

BTW, you don't need the Set keyword when you're setting variables.
 
Back
Top