fixed .xlt logic

This commit is contained in:
Domi 2024-01-30 14:22:23 +01:00
parent d66c521db0
commit b71af71035

View File

@ -310,9 +310,10 @@ namespace OfficeConverter
ConvertDocToDotx(filePath, doSubfolders, doReplace);
break;
case ".xlt":
ConvertXltToXltxAsync(filePath, doSubfolders, doReplace);
ConvertXltToXltx(filePath, doSubfolders, doReplace);
break;
default:
// Handle other file types or show an error message
Console.WriteLine($"Unsupported file type: {filePath}");
@ -373,9 +374,7 @@ namespace OfficeConverter
KillProcess("EXCEL");
}
}
private async Task ConvertXltToXltxAsync(string xltFile, bool doSubfolders, bool doReplace)
{
await Task.Run(() =>
private void ConvertXltToXltx(string xltFile, bool doSubfolders, bool doReplace)
{
try
{
@ -420,7 +419,6 @@ namespace OfficeConverter
// Handle exceptions during conversion
Console.WriteLine($"Error converting {xltFile}: {ex.Message}");
}
});
// Update UI on the main thread
System.Windows.Application.Current.Dispatcher.Invoke(() =>
@ -432,6 +430,7 @@ namespace OfficeConverter
});
}
private void ConvertPptToPptx(string pptFile, bool doSubfolders, bool doReplace)
{
PowerPoint.Application pptApp = new PowerPoint.Application();