I have the following VBA macro in my Excel workbook
Function SetValue(ByRef myRange As Range) As Integer
SetValue = 5
myRange(1, 1).Font.Color = RGB(255, 0, 255)
myRange(1, 1).Value = 10
End Function
Setting the font color works; however, setting the value causes my macro to terminate early. i.e., if I step through this in the VBA debugger, it just "ends" on the "Value = 10" line.
I've tried this syntax, but I see the same behavior:
myRange.Cells(1, 1).Value = 10
Also, it's not just the "value" field that I can't modify; I see the same behavior with this:
myRange.Cells(1, 1).Interior.Color = RGB(255, 0, 0)
Any ideas as to what's going on here? MS docs seem to indicate that these parameters ("value" and "interior color") are both readable and writeable. If it matters, this is with Office 365.