由臭氧層前輩取得
因為Excel 有多種版本, 不見每得每一種版都可以用下列的方式建立Object :
Set excelObject = CreateObject("Excel.Application") 'Excel 其它
請試試以下多種方式, for 不同Excel client user 使用
新版本的Excel , 請依Regedit.exe 查看登錄錄內, Excel 登錄的資訊就可以了
'===============================================
'initial Excel Object
'===============================================
On Error Resume Next
Set excelObject = CreateObject("Excel.Application.10") 'Excel 2000
If excelObject Is Nothing Then
Set excelObject = CreateObject("Excel.Application.11") 'Excel 2003
If excelObject Is Nothing Then
Set excelObject = CreateObject("Excel.Application.9") 'Excel 97 (Office 97)
If excelObject Is Nothing Then
Set excelObject = CreateObject("Excel.Application") 'Excel 其它
If excelObject Is Nothing Then
Beep
Messagebox "建議您安裝 Microsoft Excel 2000" & Chr(10)_
&"~~再執行此動作,謝謝!~~" ,16,"Error"
Exit Sub
End If
End If
End If
End If
因為Excel 有多種版本, 不見每得每一種版都可以用下列的方式建立Object :
Set excelObject = CreateObject("Excel.Application") 'Excel 其它
請試試以下多種方式, for 不同Excel client user 使用
新版本的Excel , 請依Regedit.exe 查看登錄錄內, Excel 登錄的資訊就可以了
'===============================================
'initial Excel Object
'===============================================
On Error Resume Next
Set excelObject = CreateObject("Excel.Application.10") 'Excel 2000
If excelObject Is Nothing Then
Set excelObject = CreateObject("Excel.Application.11") 'Excel 2003
If excelObject Is Nothing Then
Set excelObject = CreateObject("Excel.Application.9") 'Excel 97 (Office 97)
If excelObject Is Nothing Then
Set excelObject = CreateObject("Excel.Application") 'Excel 其它
If excelObject Is Nothing Then
Beep
Messagebox "建議您安裝 Microsoft Excel 2000" & Chr(10)_
&"~~再執行此動作,謝謝!~~" ,16,"Error"
Exit Sub
End If
End If
End If
End If
留言