"Unable to set the LineStyle property of the Border class" might appear in the SAS® Add-In for Microsoft Office


When you execute a stored process or generate task output in a pre-formatted Microsoft Excel worksheet, you might see the following error:

Unable to set the LineStyle property of the Border class

This error occurs when the Excel borders are corrupt. The corruption prevents you from inserting data into the worksheet using the SAS Add-In. To resolve this issue, clear the Excel borders. You can use the following VBA code to clear the borders from an entire worksheet.

Sub border()

   Selection.Borders.LineStyle = xlNone

End Sub