Yes, but I saw two problems:
1. The last argument in your action is not allowed for exports. It is only
for imports so you can identify exactly what data from a workbook you want.
I read somewhere there is a way to trick it, but I don't know what it is.
2. I took the "." out of tblMasterTestResults. I doubt that is your table
name
Try this:
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,
"tblMasterTestResults", "C:\Data\MasterTestResults.xls"
> I've set up this VB command,
>
[quoted text clipped - 6 lines]
>
> How do I set up to export ?
Stu - 26 May 2005 19:16 GMT
Thanks. I tried
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,
"tblMasterTestResults", "C:\Data\MasterTestResults.xls"
The names and locations of the table and spreadsheet are correct
But I'm still getting "Invalid outside procedure" on acExport
> Yes, but I saw two problems:
> 1. The last argument in your action is not allowed for exports. It is only
[quoted text clipped - 18 lines]
> >
> > How do I set up to export ?
Klatuu - 26 May 2005 19:22 GMT
hhhhhhhhmmmmmmmmmmm?????????
I've never seen that. Have you checked your references to be sure you have
Microsoft Excel 9.0 Object Library checked?
> Thanks. I tried
>
[quoted text clipped - 26 lines]
> > >
> > > How do I set up to export ?
david epsom dot com dot au - 31 May 2005 00:41 GMT
The debugger can get confused about the exact position of
an error on a line. If you can't see an error, look to the
left. Are you sure that you are inside a procedure?
(david)
> Thanks. I tried
>
[quoted text clipped - 30 lines]
>> >
>> > How do I set up to export ?
Ken Snell [MVP] - 26 May 2005 19:47 GMT
> Yes, but I saw two problems:
> 1. The last argument in your action is not allowed for exports. It is
> only
> for imports so you can identify exactly what data from a workbook you
> want.
> I read somewhere there is a way to trick it, but I don't know what it is.
Though not documented and Help file says it's not possible, it appears that
you can specify the Range argument for exports. Syntax is exactly the same
as that used for imports.

Signature
Ken Snell
<MS ACCESS MVP>