+ Reply to Thread
Results 1 to 2 of 2

Difficulty converting an unzipped excel file back into .xlsx again

  1. #1
    Registered User
    Join Date
    10-19-2016
    Location
    New York
    MS-Off Ver
    2016
    Posts
    1

    Question Difficulty converting an unzipped excel file back into .xlsx again

    I'm trying to convert a folder of xml that was created by unzipping an excel file back into an excel .xlsx. But I get the error

    The workbook cannot be opened or repaired by Microsoft Excel because it is corrupt
    The actual file I want to recreate is a fairly large macro-enbled .xlsm spreadsheet created with Excel 2016. I am using the xml format to archive in a git repository in order to provide version control. However, restoring a version from the archive requires that I can reverse the process.

    A minimal example with a simple spreadsheet reproduces this issue:

    **A minimal reproducible example to generate this error:**
    1. Create a new blank spreadsheet in Excel
    2. Enter "test" in cell A1
    3. Save as `test.xlsx`
    4. Rename file to `test.zip`
    5. Unzip `test.zip` as a folder named `test`
    6. Compress `test` into `test_new.zip`
    7. Rename `test_new.zip` as `test_new.xlsx`
    8. Open `test_new.xlsx` with Excel

    I am using Excel 2016. For zipping and unzipping I have tried 7zip, WinZip and PeaZip, all with the same result.

    What am I doing wrong, and how can I turn unzipped excel workbooks back into their original form?
    Last edited by dww1; 10-19-2016 at 05:48 PM.

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Difficulty converting an unzipped excel file back into .xlsx again

    You're zipping the wrong level. So you're creating a zip of test, not the contained files, you have:

    test_new.zip > test > Excel Files

    You need:

    test_new.zip > Excel Files

    So you need to navigate into test and zip the actual files, not the container

+ 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. Help with code to convert xls to xlsx and continue with xlsx file
    By 3345james in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-02-2016, 11:47 AM
  2. Replies: 0
    Last Post: 08-17-2015, 01:35 AM
  3. Replies: 3
    Last Post: 01-05-2014, 05:50 AM
  4. Replies: 4
    Last Post: 10-23-2013, 12:54 AM
  5. How to add the columns data of several xlsx files of a folder in another xlsx file
    By ravikumar00008 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-25-2012, 04:29 AM
  6. Converting a .xlsx file containing boxplots in to .htm file
    By shrimic in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-19-2012, 10:16 AM
  7. HOW DO I CONVERT XLSX FILES BACK TO EXCEL 2003?
    By vei in forum Excel General
    Replies: 5
    Last Post: 07-10-2006, 04:34 PM

Tags for this Thread

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