"Type mismtach error" using DoCmd.TransferSpreadsheet

  • Thread starter Thread starter Harry-Wishes
  • Start date Start date
H

Harry-Wishes

Hello, I am trying to export a table from Access 2003 into an Excel 2003
spreadsheet. When Access runs into the line below, I get a type mismatch
error. I've looked at the syntax nearly a dozen times but can't find the
problem. Can anyone help me figure this out? It's probably obvious but I
certainly can't see it.

The table I want to export out of Access is named "Markers" and the name of
the Excel file I want to import this table into is bnf-data.xls in this
particular example below.

Harry-Wishes


DoCmd.TransferSpreadsheet acExport, "acSpreadsheetTypeExcel9", _
"Markers", "E:\bnf-data.xls", True
 
Harry-Wishes said:
Hello, I am trying to export a table from Access 2003 into an Excel 2003
spreadsheet. When Access runs into the line below, I get a type mismatch
error. I've looked at the syntax nearly a dozen times but can't find the
problem. Can anyone help me figure this out? It's probably obvious but I
certainly can't see it.

The table I want to export out of Access is named "Markers" and the name
of
the Excel file I want to import this table into is bnf-data.xls in this
particular example below.

Harry-Wishes


DoCmd.TransferSpreadsheet acExport, "acSpreadsheetTypeExcel9", _
"Markers", "E:\bnf-data.xls", True


The defined constant, acSpreadsheetTypeExcel9, should not be in quotes. Try
this:

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, _
"Markers", "E:\bnf-data.xls", True
 
Back
Top