几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   数据库ObjectDBX (http://www.dimcax.com/hust/forumdisplay.php?f=177)
-   -   【转帖】急!我的vb代码有什么问题! (http://www.dimcax.com/hust/showthread.php?t=8587)

yang686526 2009-04-19 07:01 PM

【转帖】急!我的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


所有的时间均为北京时间。 现在的时间是 12:44 AM.