I've gotten the COM Addin to work, my problem is this. I need to allow
the user to select a range of cells (All in the same column) and then
select my addin. My addin needs to pick up this range of cells and
then parse the value of each cell in this range. I have looked,
Googled, and thought I had it, but nadda.
Here's the code I have at the moment:
' *** BEGIN CUSTOM CODE. ***
Private Sub objCommandBarBu tton_Click(ByVa l Ctrl As
CommandBarButto n, _
ByRef CancelDefault As Boolean)
Dim WkBook As Excel._Workbook = applicationObje ct.Workbooks(1)
Dim WkSheet As Excel._Workshee t = WkBook.ActiveSh eet
'Dim WkSheetNew As Excel._Workshee t =
applicationObje ct.Worksheets.A dd(Nothing,
applicationObje ct.Worksheets(1 ))
Dim Range1 As Range = DirectCast(appl icationObject.S election,
Excel.Range)
Dim cell As Range
Dim PPS As Integer = 0
'WkSheetNew.Nam e = "SubTotals"
MsgBox(Range1.A ddress())
If Debugger.Launch () Then
For Each cell In Range1.Cells
Select Case CStr(cell.Value ).Substring(0, 3)
Case Is = "PPS"
PPS += 1
End Select
Next
MsgBox("Found " & PPS & " Software Calls.")
Else
MsgBox("Couldn' t Launch the Debugger")
End If
End Sub
' *** END CUSTOM CODE. ***
Thanks,
Jody W
the user to select a range of cells (All in the same column) and then
select my addin. My addin needs to pick up this range of cells and
then parse the value of each cell in this range. I have looked,
Googled, and thought I had it, but nadda.
Here's the code I have at the moment:
' *** BEGIN CUSTOM CODE. ***
Private Sub objCommandBarBu tton_Click(ByVa l Ctrl As
CommandBarButto n, _
ByRef CancelDefault As Boolean)
Dim WkBook As Excel._Workbook = applicationObje ct.Workbooks(1)
Dim WkSheet As Excel._Workshee t = WkBook.ActiveSh eet
'Dim WkSheetNew As Excel._Workshee t =
applicationObje ct.Worksheets.A dd(Nothing,
applicationObje ct.Worksheets(1 ))
Dim Range1 As Range = DirectCast(appl icationObject.S election,
Excel.Range)
Dim cell As Range
Dim PPS As Integer = 0
'WkSheetNew.Nam e = "SubTotals"
MsgBox(Range1.A ddress())
If Debugger.Launch () Then
For Each cell In Range1.Cells
Select Case CStr(cell.Value ).Substring(0, 3)
Case Is = "PPS"
PPS += 1
End Select
Next
MsgBox("Found " & PPS & " Software Calls.")
Else
MsgBox("Couldn' t Launch the Debugger")
End If
End Sub
' *** END CUSTOM CODE. ***
Thanks,
Jody W
Comment