急!我的VB代码有什么问题!
<p>我想象CAD那样Get已打开的Excel文档,或没有打开时就建个Excel空文档.。</p><p>以下代码有什么问题或有其它方法达到这个目的吗?谢谢帮忙!</p><p>Public ExcelApp As Object ' Excel.Application<br/>'On Error Resume Next<br/>Set ExcelApp = GetObject("Microsoft Excel")<br/>If Err Then<br/> Err.Clear<br/> Set ExcelApp = CreateObject("Microsoft Excel")<br/>End If<br/>ExcelApp.Visible = True</p><p></p> On Error Resume Next<br/>Set Excel = GetObject(, "excel.Application")<br/>If Err Then<br/> Err.Clear<br/> Set Excel = CreateObject("excel.Application")<br/> If Err Then<br/> MsgBox ("不能运行excelD")<br/> Exit Sub<br/> End If<br/> End If<br/> Excel.Visible = True
页:
[1]