Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Importing / Linking / May 2005

Tip: Looking for answers? Try searching our database.

Can I Use TransferSpreadsheet to export ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stu - 26 May 2005 18:26 GMT
I've set up this VB command,

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,
"tbl.MasterTestResults", "C:\Data\MasterTestResults.xls", ,
"tblMasterTestResults"

but the compiler is highlighting acExport and saying its an "invalid outside
procedure"

How do I set up to export ?
Klatuu - 26 May 2005 19:06 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.

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>

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.