Hello,
I have an Excel VBA with the following code to save a file
It works fine, but I would like to know if there is a way I can get it to save as a zip file with a password.![]()
Please Login or Register to view this content.
Thanks
Hello,
I have an Excel VBA with the following code to save a file
It works fine, but I would like to know if there is a way I can get it to save as a zip file with a password.![]()
Please Login or Register to view this content.
Thanks
There's sample code here
Hope that helps.
RoyUK
--------
For Excel Tips & Solutions, free examples and tutorials why not check out my web site
Free DataBaseForm example
Is there a more up to date example? This is not working on excel 2007. I am also trying to zip with secure zip with a password if that makes a difference. It is my windows default.
Hello,
I am using the code from the page as suggested
I am getting an error on the line![]()
Please Login or Register to view this content.
oApp.Namespace(FileNameZip).CopyHere FileNameXls
The error is:
Run-time error'-2147024894 (80070002)':
Method 'NameSpace' of object 'IShellDispatch4' failed
any idea what is wrong?
Hello Ang12345,
This version has worked well for me. Try it out and let me know what happens.
![]()
Please Login or Register to view this content.
Macro Example
![]()
Please Login or Register to view this content.
Sincerely,
Leith Ross
Remember To Do the Following....
1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.2. Thank those who have helped you by clicking the Starbelow the post.
3. Please mark your post [SOLVED] if it has been answered satisfactorily.
Old Scottish Proverb...
Luathaid gu deanamh maille! (Rushing causes delays!)
Hi Leith,
I dont think that will work because it uses WinZip. I have to use securezip. I gave it a shot and I am getting an error for
sub or function undefined![]()
Please Login or Register to view this content.
Hello Ang12345,
I will look into to this and see if it has command line capability. If it does then it maybe possible to initiate zipping the file with VBA.
Hello, i am trying a similar code with 7zip, but i'm having a trouble with consistency, first test is successful, i delete the zip file remake the test and then not all zipped files are password protected.
Any ideas why ? do i somehow need to reset zip parameters after each item ?
Thank you![]()
Please Login or Register to view this content.
Last edited by Rolly_Sefu; 01-05-2021 at 10:51 AM.
Administrative Note:
Welcome to the forum.
We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.
Please see Forum Rule #4 about hijacking and start a new thread for your query.
If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
2. If your question is resolved, mark it SOLVED using the thread tools
3. Click on the star if you think someone helped you
Regards
Ford
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks