+ Reply to Thread
Results 1 to 2 of 2

Save xlsm file to zip file

  1. #1
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,014

    Save xlsm file to zip file

    Greetings,

    There are two excel files abc.xlsm and xyz.xlsm enclosed.
    Please download these two excel files to your desktop.
    Then open abc.xlsm and run following code.
    Please Login or Register  to view this content.
    After running code above you will see that you have a new file in your desktop named xyz.rar.
    Everyhing is okey until now.


    Now, delete abc.xlsm, xyz.xlsm, xyz.rar from your desktop.
    Then download enclosed file named klm.xlsm to your desktop.
    Then open klm.xlsm and run following code.
    Please Login or Register  to view this content.
    After running code above why there is no klm.rar file in your desktop?
    Is it not possible to create a zip file running code includes same workbook?
    I mean why I cant zip excel file, from same excel file?
    Attached Files Attached Files
    Last edited by HerryMarkowitz; 08-03-2014 at 04:31 PM. Reason: reason 1
    Sub DontForgetThese()
         If Your thread includes any code Then Please use code tags...
         If Your thread has been solved Then Please mark as solved...
         If Anybody has helped to you Then Please add reputation...
    End Sub

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Save xlsm file to zip file

    No, as far as I know you cannot do that due to file locking. However, you should be able to do a SaveCopyAs to create a copy of the current open file, then zip THAT file, then delete the copy, if you wish.

    http://msdn.microsoft.com/en-us/libr...ffice.15).aspx
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Check if file exists and if so save file incremented by 1 e.g. filename(1).xlsm
    By ratdogexcel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-16-2014, 01:15 AM
  2. Replies: 3
    Last Post: 05-21-2013, 08:22 AM
  3. Save file xls file as xlsm - macro won't run in xlsm workbook
    By captbluefin in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-07-2012, 11:39 AM
  4. [SOLVED] Save xlsm file as xlsx file
    By ccpsc in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-06-2012, 01:12 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1