抜粋ですが、 <===================Form Option Explicit On Public Class frm_test Private Sub mnu_AAA_Click(sender As System.Object, e As System.EventArgs) Handles mnu_AAA.Click
End Sub End Class <===================Module Imports Microsoft.Office.Interop Imports Microsoft.Office.Core Imports System.Runtime.InteropServices
Module Bas_Excel Public xlApp As Excel.Application Public xlClose As Boolean Public xlChart As Excel.Chart
Public xlBooks As Excel.Workbooks Public xlBook As Excel.Workbook Public xlSheets As Excel.Sheets Public xlSheet As Excel.Worksheet
Public ExObject As New Cls_ExcelClick
End Module
<===================Class Public Class Cls_ExcelClick
Public WithEvents appevent As Excel.Application
Private Sub appevent_SheetBeforeDoubleClick(Sh As Excel.Worksheet, Target As Microsoft.Office.Interop.Excel.Range, _ ByRef Cancel As Boolean) Handles appevent.SheetBeforeDoubleClick ' ' ----- Excelがダブルクリックされた時の処理 xlSheet = xlApp.ActiveSheet If Sh.Name = xlSheet.Name Then
' ----- ダブルクリックが対象物の時処理をする Shell("c:\test\Bin\Sampletest.exe", AppWinStyle.NormalFocus) Else ' ----- 対象ではないので、何もしない End If End Sub End Class