Skip to end of metadata
Go to start of metadata

Instead of using TOpenDialog, Delphi provides super simple function can select directory as following:

uses Vcl.FileCtrl;
  chosenDirectory : string;
  // Ask the user to select a required directory, starting with C:
  if selectdirectory('Select a directory', 'C:\', chosenDirectory)
  then ShowMessage('Chosen directory = '+chosenDirectory)
  else ShowMessage('Directory selection aborted');

Above is tested on Delphi 10.2

You can see another example at Select Directory in Delphi