EXCEL VBA- Export Workbook to Password-Protected ZIP file

前端 未结 1 1255
后悔当初
后悔当初 2020-12-31 19:17

Is there anyway to modify Ron De Bruin\'s code to export the current workbook to a password-protected zip file. I\'ve looked around for quite some time, and can\'t

相关标签:
1条回答
  • 2020-12-31 19:52

    I've found an accepted answer for this on another site using 7Zip......

    strDestFileName = "c:\temp\TestZipFile.zip"   
    strSourceFileName = "c:\temp\test.pdf"   
    str7ZipPath = "C:\Program Files\7-Zip\7z.exe"   
    strPassword = "MyPassword"   
    
    strCommand = str7ZipPath & " -p" & strPassword & " a -tzip """ & strDestFileName & """ """ & strSourceFileName & """"
    Shell strCommand 
    
    0 讨论(0)
提交回复
热议问题