依据:
http://msdn.microsoft.com/zh-cn/library/7t9k08y5(v=VS.80).aspx
CreateObject 函数 (Visual Basic)
http://msdn.microsoft.com/zh-cn/library/e9waz863(VS.80).aspx
GetObject 函数 (Visual Basic)以MSDN介绍的Excel为例,讨论的问题如下:
1 test.xls是否存在(指定路径).
2 test.xls是否打开(避免重复打开)
3 test.xls如果没有打开,打开test.xls现在网上有很多VB无缝控制Excel程序有很多问题
最突出的问题,就是CreateObject + Add方法,结果是打开了N个Excel
发此帖的目的是希望各位大侠积极参与,小结一个通用的方法,实现CreateObject+GetObject在各个应用程序中的应用.
如word  Ppt cad中的应用,道理都是一样的.Private Sub getExcel()
    Dim fileName As String = "c:\vb\test.xls"    If Not My.Computer.FileSystem.FileExists(fileName) Then
        MsgBox(fileName & " does not exist")
        Exit Sub
    End If    ' Set the object variable to refer to the file you want to use.
    Dim excelObj As Object = GetObject(fileName)
    ' Show Excel through its Application property. 
    excelObj.Application.Visible = True
    ' Show the window containing the file.
    Dim winCount As Integer = excelObj.Parent.Windows.Count()
    excelObj.Parent.Windows(winCount).Visible = True    ' Insert additional code to manipulate the test.xls file here.
    ' ...    excelObj = Nothing
End Sub