设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

返回列表 发新帖
查看: 961|回复: 9
打印 上一主题 下一主题

[报表] 如何将报表的数据导入到Excel??

[复制链接]
跳转到指定楼层
1#
发表于 2002-8-23 00:40:00 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
用了Office连接到Excel,但是表格和图片都无法显示出来?有什么好办法吗?
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 分享淘帖 订阅订阅
2#
发表于 2002-8-23 01:00:00 | 只看该作者
docmd.outfromatto語句,可以我寫榙了。不過自己一試即知。
3#
 楼主| 发表于 2002-8-23 03:47:00 | 只看该作者
好像不行啊!我设置了个命令按钮,在单击事件中加入了"docmd.outformatto",但后面怎样写呢?我在帮助里没有找到以上命令的解释。
4#
发表于 2002-8-23 06:26:00 | 只看该作者
唉,就先创建一个TransferSpreadsheet的宏,再把宏另存为模块就知道嘛
5#
 楼主| 发表于 2002-8-23 08:34:00 | 只看该作者
好像还是不行?能否举个例子呢???
6#
发表于 2002-8-23 16:00:00 | 只看该作者
*********在帮助-->索引里敲入"TransferSpreadsheet Action"然后回车. 咋说呢,如果真要学它,你要找方法,多看书,不然你无法系统的使用它的.刚开始学的时候不明白可以看help的,它比任何人的回答还详细,正确.


TransferSpreadsheet Action
        

You can use the TransferSpreadsheet action to import or export data between the current Microsoft Access database (.mdb) or Access project (.adp) and a spreadsheet file. You can also link the data in a Microsoft Excel spreadsheet to the current Microsoft Access database. With a linked spreadsheet, you can view and edit the spreadsheet data with Microsoft Access while still allowing complete access to the data from your Microsoft Excel spreadsheet program. You can also link to data in a Lotus 1-2-3 spreadsheet file, but this data is read-only in Microsoft Access.

Setting

The TransferSpreadsheet action has the following arguments.

Action argument Description
Transfer Type The type of transfer you want to make. Select Import, Export, or Link in the Transfer Type box in the Action Arguments section of the Macro window. The default is Import.
  Note   The Link transfer type is not supported for Access projects (.adp).
Spreadsheet Type The type of spreadsheet to import from, export to, or link to. You can select one of a number of spreadsheet types in the box. The default is Microsoft Excel 8.
  Note   You can import from and link (read-only) to Lotus .WK4 files, but you can't export Microsoft Access data to this spreadsheet format. Microsoft Access also no longer supports importing, exporting, or linking data from Lotus .WKS or Microsoft Excel version 2.0 spreadsheets with this action. If you want to import from or link to spreadsheet data in Microsoft Excel version 2.0 or Lotus .WKS format, convert the spreadsheet data to a later version of Microsoft Excel or Lotus 1-2-3 before importing or linking the data into Microsoft Access.
Table Name The name of the Microsoft Access table to import spreadsheet data to, export spreadsheet data from, or link spreadsheet data to. You can also type the name of the Microsoft Access select query you want to export data from. This is a required argument.
  If you select Import in the Transfer Type argument, Microsoft Access appends the spreadsheet data to this table if the table already exists. Otherwise, Microsoft Access creates a new table containing the spreadsheet data.
  In Microsoft Access 2000, you can't use an SQL statement to specify data to export when you are using the TransferSpreadsheet action. Instead of using an SQL statement, you must first create a query and then specify the name of the query in the Table Name argument.
File Name The name of the spreadsheet file to import from, export to, or link to. Include the full path. This is a required argument.
  Microsoft Access creates a new spreadsheet when you export data from Microsoft Access. If the file name is the same as the name of an existing spreadsheet, Microsoft Access replaces the existing spreadsheet, unless you're exporting to a Microsoft Excel version 5.0, 7.0, 8.0 or Excel 2000 workbook. In that case, Microsoft Access copies the exported data to the next available new worksheet in the workbook.
  If you are importing from or linking to a Microsoft Excel version 5.0, 7.0, 8.0 or Excel 2000 spreadsheet, you can specify a particular worksheet by using the Range argument.
Has Field Names Specifies whether the first row of the spreadsheet contains the names of the fields. If you select Yes, Microsoft Access uses the names in this row as field names in the Microsoft Access table when you import or link the spreadsheet data. If you select No, Microsoft Access treats the first row as a normal row of data. The default is No.
  When you export a Microsoft Access table or select query to a spreadsheet, the field names are inserted into the first row of the spreadsheet no matter what you select in this argument.
Range The range of cells to import or link. Leave this argument blank to import or link the entire spreadsheet. You can type the name of a range in the
7#
发表于 2002-8-23 16:38:00 | 只看该作者
docmd.outformat,可以輸出為html,execl,txt,xml,email等很多格式的,我經常用的。
8#
 楼主| 发表于 2002-8-23 18:00:00 | 只看该作者
我的意思是直接将报表导入到Excel,包括原先的图片和表格.
9#
发表于 2002-8-23 18:05:00 | 只看该作者
以下是引用waltonw在2002-8-23 10:00:15的发言:
我的意思是直接将报表导入到Excel,包括原先的图片和表格.



这个我已经试,过在2000里导出的只有数据,没有图片,没有格式,没有线条,导入导出本来就只有数据的.
如果要达到你的目的,请在Excel先建立一个模板,然后到Access取数据吧.
10#
 楼主| 发表于 2002-8-26 02:18:00 | 只看该作者
版主,能否讲的具体一些,比如说建立了个模板,如何将ACCESS的数据导入到此模板中.谢了!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-11-29 22:32 , Processed in 0.086351 second(s), 34 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表