/// <summary>
 /// Creates new COM-Object of the Excel application.
 /// </summary>
 /// <param name="visible">The flag indicates to show the Excel application or not.</param>
 /// <returns>Returns new instance of Microsoft.Office.Interop.ExcelAplication.</returns>
 internal static Excel.Application GetInstanceExcelApplication(bool visible = false)
 {
     try
     {
         // Create COM Object.
         return(new Excel.Application
         {
             // Disable displays certain alerts and messages while a macro is running.
             DisplayAlerts = false,
             // Determines whether the object is visible.
             Visible = visible
         });
     }
     catch (Exception ex)
     {
         DataUtil.ShowErrorMessage($"Cannot create an Excel COM Object." +
                                   $"\n {ex.Message} " +
                                   $"\nThe current action will be canceled.");
         return(null);
     }
 }