I have been tackling this for a while, and it is very frustrating. No matter what I do, ExportFileName is being ignored during an Excel export.
Instead it puts the file in the default directory, wherever it was last saved. I wonder if it is a registry issue.
string dir = "C:\\";
string fileName = "test.xls";
ExcelExportDescription exportDescription = new ExcelExportDescription();
DGVEExcelExportSettings exportSettings = new DGVEExcelExportSettings();
exportSettings.OpenFolderAfterGeneration = false;
exportSettings.ExportFileName = dir + fileName;
exportSettings.OpenFileAfterGeneration = true;
exportSettings.ExportColumnHeaders = false;
exportSettings.ExportRowHeaders = false;
DGVEExportingManager.Export(dataGridView2, exportDescription, false);