Changing an Excel cell's backcolor using hex results in Excel displaying completely different color in the spreadsheet

后端 未结 7 1901
灰色年华
灰色年华 2021-02-07 13:27

So I am setting an Excel cell\'s Interior Color to a certain value, like below:

worksheet.Cells[1, 1].Interior.Color = 0xF1DCDB;

However, when

相关标签:
7条回答
  • 2021-02-07 13:59

    Try worksheet.cells(1,1).interior.color = rgb(241, 220, 219).

    EDIT I'm dumb, just noticed you're not using VBA 8). This is a bit of a long stretch but can you try sending it as decimal? For what it's worth, ...interior.color = &HF1DCDB works in VBA as does = 15850715.

    0 讨论(0)
提交回复
热议问题