Excel VBA Borders.TintAndShade corrupting cells in 360 64 bit but works fine in 2016 32 bit

GLENN G 1 Reputation point
2020-11-09T23:00:57.353+00:00

The following snippet works fine in Excel 2016 32bit to set cell borders. However, the same code crashes in Excel 360 64bit with an error on what ever method accesses the border object immediately following the .TintAndShade. If the script is exited after the .TintAndShade without accessing the border object again, the workbook will not save. Excel reports it as corrupted and cannot recover it, even though it looks fine on the screen. It appears that something in the .TintAndShade and nuking the cell border.

I was able to work around this just by not setting .TintAndShade and leaving it as the default, so I don't really need a workaround. I would like to know if this is a known issue or if I am using .TintAndShade wrong?

Thoughts?

<selecting some range of cells>

With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex = 1
.TintAndShade = 0
.Weight = xlThin
End With

Thanks,
G^2

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
38,642 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2020-11-09T23:07:45.133+00:00

    Excel development is not currently supported here on QnA. They're actively answering questions in dedicated forums here.
    https://answers.microsoft.com/en-us/msoffice/forum/msoffice_excel-msoffice_custom
    https://social.msdn.microsoft.com/Forums/Lync/en-US/home?forum=exceldev

    --please don't forget to Accept as answer if the reply is helpful--

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.