Change the font colour

In excel sheet ,in cell B1 a value is updated I have to change the value to red font hoelw to do that

Hi,
check this post:

Can you explain me with xaml code

Hi @sruthesanju

Use invoke VBA activity,use inside the excel application scope and pass the text file which has VBA procedure.

Refer this link for VBA code for change font color.

Hi @sruthesanju
To change the font color, you can check this video

@balupad14

Regards,
Nived N
Happy Automation

1 Like

Hi @sruthesanju

Please try the below method.

  1. Create a text file and past the below vb.net code.

Public Function color()
Dim rangeToFormat As Excel.Range
rangeToFormat = xlWorkSheet.Range(“B1”, “B1”)
rangeToFormat.Interior.Color = RGB(255,0,0)
End Function

  1. Use invoke code activity to execute the above code. Attached screen shot for your reference.

image

Feel free to reach us at any time if you have any doubts. Thanks.

Happy Automation

@sruthesanju

Take Excel application scope activity and then drag the activity Set Range Color.

You can set the properties of Set Range color like this
Color = system.Drawing.Color.Red.
Range =“B1” or what u want
Sheetname =“XXX”

Regards
Anand

I did not found Cell Font activity in balareva package

Invoke VBA: Programmatic access to Visual Basic Project is not trusted
getting this error

but its change cell color

Hi @airwaveexporter

Please do this one time on excel

In order for this activity to work, Trust Access to the VBA project object model must be enabled from Excel (File > Options > Trust Center > Trust Center Settings > Macro Settings > Select the Trust Access to the VBA project object model check box).

1 Like