Applescript - Apri il file excel protetto da password

1

Esiste un modo per Applescript di aprire una cartella di lavoro di Excel (.xls) protetta da password?

Vedo che nella libreria ci sono funzioni per verificare se una cartella di lavoro ha una password, ma non conosco la sintassi corretta per l'apertura di un wb con protezione tramite password.

Tell application "Microsoft Excel"
  -- set theWb to path of .... etc.
  open theWb with password "abc" ? <--- what should go here?
end tell
    
posta klutznic 17.06.2016 - 08:56
fonte

1 risposta

1

C'è un modo per aprire una cartella di lavoro di Excel (xlsx, nel mio esempio) che è protetta dalla cartella di lavoro e / o dal foglio. Puoi utilizzare il seguente script:

set passwd to "1234" -- whatever you want
set theWbpath to "/Users/xxxxx/Desktop/number1.xlsx" -- example path
set theWb to "number1.xlsx" -- example file
set theSheet to "sheet1" -- example name of sheet
tell application "Microsoft Excel"
    open theWbpath                
    unprotect workbook theWb ¬ --> 
        password passwd        --> workbook part, can be left out
    unprotect sheet theSheet ¬ --> 
        password passwd        --> sheet part, can be left out
end tell
    
risposta data 17.06.2016 - 16:17
fonte

Leggi altre domande sui tag