Public Function エクセルのブックを開く()
Dim channelnum
Dim TEMP
On Error GoTo KIDO
Channelnum = DDEInitiate("Excel", "System")
On Error GoTo 0
On Error GoTo MUSI
DDEExecute channelnum, "[OPEN(""C:\フォルダ名\ブック名.xls"")] 'フォルダ・ブック名
On Error GoTo 0
DDETerminate channelnum
Exit Function
KIDO:
If Err = 282 Then
TEMP = Shell("C:\MSOFFICE\Excel\Excel.exe",1) 'PCのインストール状況に合わせる
Resume
End If
Resume Next
MUSI:
If Err = 286 Then
Resume Next
End If
Resume OWARU
OWARU:
On Error Goto 0
End Function