"Type mismtach error" using DoCmd.TransferSpreadsheet

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
 
D

Dirk Goldgar

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top