using (var openFileDialog1 = new OpenFileDialog()) { openFileDialog1.Reset(); if (!string.IsNullOrEmpty(ExcelFilePath)) {
It seems like all you need to do is the following:
string path; // this is the path that you are checking. if(Directory.Exists(path)) { openFileDialog1.InitialDirectory = path; } else { openFileDialog1.InitialDirectory = @"C:\"; }
That is unless I'm missing something.