Does your data grid view cell value return DBNull sometimes, so that you crash on the Replace function.

You can use
QryColSentDataGridView.Rows(irow).Cells(2).Value.ToString()
It's because DBNull.Value.ToString() is equal to empty string ("")

However, this will lead to another error when the Value is NOTHING, it's because NOTHING cannot ToString()