• Exactly that. Set password to empty ("") and SaveAs. Then the connection manager shouldn't complain.

    $comments = @'

    Script name: Remove-Password.ps1

    Created on: Tuesday, July 03, 2007

    Author: Kent Finkle

    Purpose: How can I use Windows Powershell to

    Remove the Password When Opening an Excel Spreadsheet?

    '@

    #-----------------------------------------------------

    function Release-Ref ($ref) {

    ([System.Runtime.InteropServices.Marshal]::ReleaseComObject(

    [System.__ComObject]$ref) -gt 0)

    [System.GC]::Collect()

    [System.GC]::WaitForPendingFinalizers()

    }

    #-----------------------------------------------------

    $xl = new-object -comobject excel.application

    $xl.Visible = $True

    $xl.DisplayAlerts = $False

    $wb = $xl.Workbooks.Open("C:\Scripts\Test.xls",0,$False,1,"%reTG54w")

    $wb.Password = ""

    $a = $wb.SaveAs( "C:\Scripts\Test.xls")

    $a = Release-Ref($wb)

    $a = Release-Ref($xl)

    -------------------------------------------------------------------------
    Normal chaos will be resumed as soon as possible. :crazy: