设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

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

[与其它组件] ACCESS数据转为EXCL时的问题

[复制链接]
跳转到指定楼层
1#
发表于 2003-12-27 00:53:00 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
我想把一个表中的数据转为EXCEL格式,转出后的格式由VBA来定议,包括字体及表格.但我把在EXCEL中录制的宏加入到ACCESS中时不能运行.请帮助看一看应该怎样做才对.

DoCmd.OutputTo acTable, "TMP_SUM", "MicrosoftExcel(*.xls)", "C:\TMP_SUM.XLS", True, ""

  '以下是由EXCEL生成的宏代码
  RANGE("A1:E1").Select
  Selection.Font.ColorIndex = 5
  Selection.Font.ColorIndex = 5
  RANGE("A1:E1").Select
  With Selection
    .horizontalAlignment = xlLeft
    .verticalAlignment = xlBottom
    .WrapText = False
    .Orientation = 0
    .AddIndent = False
    .IndentLevel = 0
    .shrinkToFit = False
    .MergeCells = False
  End With
  With Selection
    .horizontalAlignment = xlCenter
    .verticalAlignment = xlBottom
    .WrapText = False
    .Orientation = 0
    .AddIndent = False
    .shrinkToFit = False
    .MergeCells = False
  End With
  'Range("A2:E13").Select
  Selection.Borders(xlDiagonalDown).LineStyle = xlNone
  Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  With Selection.Borders(xlEdgeLeft)
    .LineStyle = xlContinuous
    .Weight = xlThin
    .ColorIndex = xlAutomatic
  End With
  With Selection.Borders(xlEdgeTop)
    .LineStyle = xlContinuous
    .Weight = xlThin
    .ColorIndex = xlAutomatic
  End With
  With Selection.Borders(xlEdgeBottom)
    .LineStyle = xlContinuous
    .Weight = xlThin
    .ColorIndex = xlAutomatic
  End With
  With Selection.Borders(xlEdgeRight)
    .LineStyle = xlContinuous
    .Weight = xlThin
    .ColorIndex = xlAutomatic
  End With
  With Selection.Borders(xlInsideVertical)
    .LineStyle = xlContinuous
    .Weight = xlThin
    .ColorIndex = xlAutomatic
  End With
  With Selection.Borders(xlInsideHorizontal)
    .LineStyle = xlContinuous
    .Weight = xlThin
    .ColorIndex = xlAutomatic
  End With
[em01]
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 分享淘帖 订阅订阅
2#
发表于 2004-1-9 01:48:00 | 只看该作者
一起关注这个问题
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-29 04:41 , Processed in 0.132650 second(s), 25 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

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