查看单个帖子
旧 2009-04-19, 07:01 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】急!我的vb代码有什么问题!

急!我的vb代码有什么问题!
www.dimcax.com
急!我的vb代码有什么问题!
我想象cad那样get已打开的excel文档,或没有打开时就建个excel空文档.。
以下代码有什么问题或有其它方法达到这个目的吗?谢谢帮忙!
public excelapp as object ' excel.application
'on error resume next
set excelapp = getobject("microsoft excel")
if err then
err.clear
set excelapp = createobject("microsoft excel")
end if
excelapp.visible = true
on error resume next
set excel = getobject(, "excel.application")
if err then
err.clear
set excel = createobject("excel.application")
if err then
msgbox ("不能运行exceld")
exit sub
end if
end if
excel.visible = true
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)