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 / Developer Toolkits / September 2004

Tip: Looking for answers? Try searching our database.

OutPutTo Excel Spreadsheet

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Hon To - 29 Sep 2004 23:33 GMT
I am looking for a way to export my Access datasheet to a
specified Excel Worksheet. I found that both the
TransferSpreadsheet Method and the OutPutTo Method only
allow me to export the datasheet to a specified Excel
file, but not to the speicifed worksheet level.

Anyone could lend a helping hand on this issue?

Thanks in Advance!

H.T.
Jamie Collins - 30 Sep 2004 11:36 GMT
> I am looking for a way to export my Access datasheet to a
> specified Excel Worksheet.

For an existing Excel table e.g. worksheet:

 INSERT INTO
   [Excel 8.0;database=C:\MyWorkbook.xls;].[MyWorksheet$]
 (MyCol1, MyCol2, MyCol3)
 SELECT
   ColA AS MyCol1,
   ColB AS MyCol2,
   ColC AS MyCol3
 FROM
   MyTable
 ;

To create a new Excel workbook/worksheet/table:

 SELECT
   ColA AS MyCol1,
   ColB AS MyCol2,
   ColC AS MyCol3
 INTO
   [Excel 8.0;Database=C:\NewWorkbook.xls;].MyBookLevelName
 FROM
   MyTable
 ;

To create a new table, the defined Name (named Range) must not already
exist. Therefore, first issue a DROP TABLE e.g.

 DROP TABLE
   [Excel 8.0;Database=C:\NewWorkbook.xls;].MyBookLevelName
 ;

Jamie.

--
 
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.