| 网站首页 | 新闻 | 新书 | 专家 | 技巧 | 源码作品 | 工具/资源 | 商城 | 风采 | 留言 | 论坛 | 网址 | 承接 | 
您现在的位置: Access/Office中国 >> 技巧 >> Access >> OFFICE集成系统 >> 文章正文 用户登录 新用户注册
在Access中调用Excel无法彻底关闭         ★★★
在Access中调用Excel无法彻底关闭
作者:未知 文章来源:Access911 点击数: 本日:{$DayHits} 更新时间:2005-2-4 22:22:18


Office 组件都有一个 Quit 方法,直接调用 Quit 方法可以彻底退出该程序
以下以Excel为例子:
Function Automation_To_Excel()
    Dim objExcel As Object
   
    ' Create a new instance of Excel.
    Set objExcel = CreateObject("Excel.Application")
   
    ' Show the instance of Excel on the screen.
    objExcel.Visible = True
   
    ' Open a file named SampleFile.xls
    objExcel.Workbooks.Open ("C:\My Documents\SampleFile.xls")
   
    ' Explicitly close the instance of Excel to free up memory
    ' and set the variable to Nothing to free up the name
    ' space in access.
    objExcel.Quit
    Set objExcel = Nothing
End Function

文章录入:tm    责任编辑:tmtony 
  • 上一篇文章:

  • 下一篇文章:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    专 题 栏 目
    最 新 热 门
    最 新 推 荐
    相 关 文 章
    EXCEL减肥一得
    轻松调整Excel奇数行行高
    创建一个温度计式的Exce
    开学后,在按年级整理各
    让Excel中人名显示更美观
    在Excel多个工作表间快速
    Excel技巧:将图表另存为
    让文本文件随Excel自选图
    在同一Excel图表工作表中
    不让Excel图表随源数据改
    网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)