I have no idea why setting the dgv currentcell property to nothing would effect the code. But, I also don't have any idea what line is causing the error or the other place you needed to set the currentcell property.