Hi Team,
I am trying to perform the following actions in blueprism
Add columns to excel - used to add a new column at position D
Color Cell - used to change the background color of cell
I am adding them as a code stage in a new action in Excel VBO object. Please review the code and suggest on how to correct them, or what code should be used to perform the required functions.
Color Cell
Dim RR As Object
Dim excel As Object
Try
RR = GetWorksheet(Handle, WorkBookName, WorkSheetName)
RR.Activate()
excel = RR.Application
RR.UsedRange.Select()
RR.Interior.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Red)
RR.Cells(1, 2) = "Red"
Success = True
Catch e As Exception
Success = False
Message = e.Message
End Try
Filter Cell
'Dim Selection as Range
'Dim excel As Object
Dim Columns as Object
Dim RR As Object
Try
RR = GetWorksheet(Handle, WorkBookName, WorkSheetName)
RR.Activate()
'excel = RR.Application
RR.UsedRange.Select()
Columns("D:D").Insert(Shift:=-4161, CopyOrigin:=0)
'Range("D1").Value = "Loc"
'Selection.Insert(Shift:=-4161, CopyOrigin:=0)
'Selection.Insert(Shift:=-4161, CopyOrigin:=0)
Success = True
Catch e As Exception
Success = False
Message = e.Message
End Try