transferSpreadsheet???

  • Thread starter Thread starter Downie
  • Start date Start date
D

Downie

How do I transfer a table to a spreadsheet in VB for Applications?

DoCmd.TransferSpreadsheet.??????
 
I THINK I'M Getting closer. Seeing syntax though

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, excel,
"C:\PRSPREADSHEETS\jobs.xls"
 
I THINK I'M Getting closer. Seeing syntax though

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, excel,
"C:\PRSPREADSHEETS\jobs.xls"

What is
excel
in yourcode?

Is that supposed to be the name of the table or query in your database
that you wish to export?
Then put it within quotes (it's supposed to be a string).

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "excel",
"C:\PRSPREADSHEETS\jobs.xls"

If that is not the name of the table, but a variable, then:

Dim excel as string
excel = "The Name of Table or Query"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, excel,
"C:\PRSPREADSHEETS\jobs.xls"

Then your code should work without quotes around excel.
 
Back
Top