This function imports the Spire.XLS converter functions

function ImportXLSConverterFunctions {
    param (
        # The path for the folder containing the XlsConverter program installation.
        [ValidateScript( {(Test-Path -Path $_ -ErrorAction SilentlyContinue)})]

    try {        
        # Import the Spire.XLS dlls
        # Use ReadAllBytes to load instead so that there is no lock on the dll files when we're done
        # This ensures that the dll files can be deleted afterwards
        Write-Information "Loading the Spire.XLS dll."
        if (![System.Reflection.Assembly]::Load([IO.File]::ReadAllBytes("$($xlsConverterFolderPath)\Spire.License.dll"))) {
            throw "Failed to load the Spire.License dll."
        if (![System.Reflection.Assembly]::Load([IO.File]::ReadAllBytes("$($xlsConverterFolderPath)\Spire.pdf.dll"))) {
            throw "Failed to load the Spire.Pdf dll."
        if (![System.Reflection.Assembly]::Load([IO.File]::ReadAllBytes("$($xlsConverterFolderPath)\Spire.XLS.dll"))) {
            throw "Failed to load the Spire.XLS dll."

        # Apply License file
    catch {
        Write-Error "Exception occurred on line $($_.InvocationInfo.ScriptLineNumber):`r`n$($_.Exception.Message)"
    finally {
        # Nothing to do