I have a VBA code as below… The purpose of this VBA code to find & highlight special text “INV” which it found in cell by cell within range “A2:A4” in excel file.
I know how to use invoke VBA activity. But i dont know about the Invoke Code Activity and declare arguments .
Pls check and make a xaml file… i want to check and study from this.
Thanks in advance!
Dim strTest As String
Dim strLen As Integer
strTest = “INV”
strLen = Len(strTest)
For Each Cell In Sheet1.Range(“A2:A4”)
If InStr(Cell, strTest) > 0 Then
Cell.Characters(InStr(Cell, strTest), strLen).Font.Color = vbRed
Cell.Characters(InStr(Cell, strTest), strLen).Font.Bold = True
End If
Next
Invoke Code is strictly for VB.NET code.
VBA runs on an Excel workbook. If you absolutely have to run VBA code on a workbook, it either needs to have that code in a Sub inside that workbook, or you can make an empty workbook and pack that code in it (adding enough code to open and close that other workbook)