Results 1 to 5 of 5

Corrupt Workbook on Open

Threaded View

JCOENG Corrupt Workbook on Open 08-23-2017, 06:33 PM
xlnitwit Re: Corrupt Workbook on Open 08-24-2017, 02:33 AM
JCOENG Re: Corrupt Workbook on Open 08-24-2017, 06:46 AM
xlnitwit Re: Corrupt Workbook on Open 08-24-2017, 07:19 AM
JCOENG Re: Corrupt Workbook on Open 08-24-2017, 10:02 PM
  1. #1
    Registered User
    Join Date
    06-08-2010
    Location
    Orange County, CA
    MS-Off Ver
    Excel 2010
    Posts
    12

    Corrupt Workbook on Open

    Hello,

    I'm going completely nuts. I have a workbook that has several modules of code, some forms, and one sheet with code on the sheet. I have issues where this particular sheet keeps getting corrupt. The code on the sheet is used to refresh some dropdown validation lists upon activating the sheet or selecting values in one of the cells. Every time I save the workbook with this sheet active, the workbooks becomes corrupted. *there is a caveat to this...just not sure what it is...

    I've taken all of the code off of the sheet and put it into modules and added buttons to call them manually and just when I thought all was working fine, saved and reopened many times while on the particular sheet, and all was working, I went to open the file one more time to save it out as a template and boom, corrupt, getting the message "we found an error...would you like to repair" Choosing repair only modifies this one sheet.

    Both "versions" will corrupt the file. The 1st version I can easily repeat. Simply open the file, select the "Delta" sheet and save it (you can even return to the rev sheet and save again, it seems it just that one save on the delta sheet kills it), then close and the file is corrupt (please see note below). The 2nd version I did all the same testing/playing trying to make it corrupt and it was fine...until it wasn't. I have no idea what took it from good to bad. I had many working versions, saved in my version history (dropbox) as I kept testing and kept saving on different active sheets etc but to find a file I could open again I had to go back 8 versions, when I know fully all the others after that had been working hence why they were "saved" versions. I wouldn't save a corrupt workbook. Any of those first 8 would be corrupt upon opening. I went back to this version, re-added the code, didn't even execute it, saved on a different sheet. Opened and it was corrupt. Interesting to note, when I opened the last "working" file it was saved to the sheet that has been causing the issues.

    Note: As I went to upload files to this I figured I'd do another test to confirm the issues happens with the files I'm uploading. I take the same file I've had issue with. I have a "last known good" file in a separate directory. I copy the file out of here, into the main folder, open the file, select delta sheet, save, close, re-open, boom corrupt. But I took this same "last known good" file and put it into a different directory. Do the same things and it reopens fine. The directory was a sub folder of the main one I was in with the corrupt file. Now I can't get it to become corrupt. Thinking it could be a file count issue, I copied the contents of the folder into the sub directory to create the same "environment" and still no issue. It seems like the sheet will work, work work, then fail and you have to go back 8-10 versions to get another one to open. I'm completely lost.

    Given that both versions have issues, and I'm assuming they are the same issue just manifesting differently, I'm hoping to fix the first version and move on from there. Can anyone help take a look at the file and see if you find anything that is glaring bad practice or if you know would cause this issue? If found that I have to call the functions with buttons I'll go back to that. The main issue is stability, 2nd issue is compare speed which might be related.

    The use for the workbook is to maintain revision history and change data with bills of materials for electronic PCB assembly, this is done by "exporting" files from this main document. The exported files contain just the data necessary to view the BOM and the changes from the last version and links are broken, then saved as a standard .xlsx file.

    The idea is you make changes on the 001 sheet (can be more, 002, 003 etc) then use the "delta tab" to select another file in the same directory, the last exported file, Rev A, B etc), then select the sheet that contains the data you want to compare "from" then select another workbook, default is current but tool can be used to compare old version also, then select the sheet in that 2nd file. Hit Compare to pull in all of the data...review, add notes etc, then click export which will copy that sheet and rename it appropriately while removing code from the actual sheet to prepare it for final export. when all done creating delta sheets the user returns to the "Rev" Sheet, completes the details on the new Rev, including adding hyperlinks to the delta sheets using the selected cell and the yellow button. Then the user clicks the red button to export the workbook in the "dumb" form to prepare for sending to the suppliers. Exporting the workbook copies over specific sheets, removes code, breaks links and saves with specific file name in the same directory.

    The "compare" process used to happen almost instantly, within 1-2sec. Now Its taking between 10-20sec, not sure why or if it relates to the file becoming corrupt. I've attached 3 files. 2 for data reference that were exported, 1 as the master .xlsm. Note there is some code called by the blue button on the rev sheet that finds the dropbox path and attempts to save the doc in a specific directory. I don't think this is related as its only called when initially saving the file from a template form into a working file. Just wanted to let you know it was there. I chose to use a lot of shapes that call code or provide instructions so they can be easily deleted with vb upon export so the exported file has less clutter and unimportant features to the end user.

    Any feedback would be really appreciated. Thank you!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Corrupt files> workbooks.open> excel crash
    By ayush002 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-27-2016, 03:00 PM
  2. [SOLVED] Close Acrobat from VBA if it tries to open a corrupt file
    By n_ant in forum Excel Programming / VBA / Macros
    Replies: 27
    Last Post: 05-06-2015, 02:34 PM
  3. Corrupt file. Fail to open using the workbooks.open method
    By Mortphi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-27-2013, 01:48 AM
  4. Corrupt files open and freeze... help!
    By Hambone70 in forum Excel General
    Replies: 2
    Last Post: 02-09-2011, 09:58 AM
  5. [SOLVED] corrupt document and open and repair command
    By chipsoly83 in forum Excel General
    Replies: 4
    Last Post: 12-11-2009, 08:38 AM
  6. Corrupt Workbook
    By SDruley in forum Excel General
    Replies: 12
    Last Post: 09-26-2009, 12:09 AM
  7. Can i open or recover a corrupt document in 2007
    By jesika in forum Word Formatting & General
    Replies: 1
    Last Post: 04-15-2009, 05:14 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