How would I go about specifying a string path for opening a excel file knowing that the excel file's file name will always change or at least plug in the most recent saved excel file in that folder to the string path? For example,
string PATH = @"C:\myFileNameWillAlwaysCHange.xlms or mostRecentFile.xlms";
string connection = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + PATH + ";Extended Properties=Excel 12.0";
I was wondering if the folder that the excel file will be in will be the only excel file, if there was a way to specify the path base on any (only) excel file in that folder and plug it in for the string path?