# Solved: Warning: Excel found unreadable content in filename.xlsm. Do you want to .



## Keebellah (Mar 27, 2008)

Excel 2010, W7-64 Enterprise

*Warning: Excel found unreadable content in filename.xlsm. Do you want to recover the contents of this workbook?
If you trust the source of this workbook, click Yes.*

I click ' Yes ' and everything, but really everything functions properly. 
I Can also customize everything to the VBA Project for change, save this file gives no problems or warnings, this happens at home as well as at work. 
While searching using Google I notice that it often occurs and I read and tried most of the offered tips but without result.
1.	I have used Code Cleaner which makes it easy to find out if there are errors but to no avail. The great advantage is that you can export the entire VBA project modules.
2.	Using CustomUI-Editor I removed my Ribbon XML code file and saved it as xlsx (without macros)
3.	Opened the file again; still the warning, removed some of the temporary worksheets; checked everything; because the file is macro triggered there are no formulas.
4.	File saved, re-opened it again, and  no warning anymore. 
5.	Created a simple macro to have in a new module
6.	Closed everything, re-opened and still no warning.
7.	Using Code Cleaner again I imported the previously exported modules.
8.	Using CustomUI-Editor again I placed the original XML code I had written. 
9.	Open file and still again no warning. Did everything, checked all macros. Ran most of the processes.
An additional macro removes all ' named ranges ' and refreshes it after a new file is created to avoid possible external references.
10.	Saved the file, closed Excel and re-opened is, still no issues, it still works.
I run the macro that saves the file with a different filename and in the same location and preserving all data , no problem; but if I run the macro to produce a new fresh file deleting the entered data (employee names and the monthly worksheets which will be replaced by a blank sheet for every month), reset all named ranges and using SaveAs for the different filename also in the same location and then Quit Excel; re-open this file I get the warning again!!!
Very strange, as a test I removed all of the VBA project and reimported it again and then (in most cases) the file works fine, but what annoys me the most is the fact that there is no clear reason or error message to tell me where does it go wrong? Where is this warning message triggered and WHAT triggers it? 
To make a long story short, why is the error trapping for Excel itself so bad and incomplete?
About this file:
	Its a timesheet with 12 worksheets (one for every month), year-bound and employee data
	a new file is created every year (using the macro for this) and this works perfectly with a populated sheet
	The problem only occurs if I run the macro that creates a new file with blank employee data and empty month sheets

Thanks for reading (if you got this far)
Any advice, tip is welcome.

The attached file lists the contenst of the VBA project just to show the complexity 

PS All advices about the registry settings I found and I tried some of them but none worked.


----------



## 20_2_Many (Jun 30, 2012)

what is the content of the Macro " &#8216;produce&#8217; a new &#8216;fresh file&#8217; deleting the entered data (employee names and the monthly worksheets which will be replaced by a blank sheet for every month), reset all named ranges " (including any other macros or functions it may call)


----------



## Keebellah (Mar 27, 2008)

I think I found something.
I'll post it this evening after I run some more tests.
If it is what I think, it is still strange that excel throws the warning with a text that does not really explain the problem


----------



## Keebellah (Mar 27, 2008)

What the macro does is really very simple.
*1. The current file is saved (Planning-Dept-2012.xlsm)
2. The named range that contains the current year is updated to current year + 1
3. The file is saved as (Planning-Dept-2013.xlsm)
3. The 12 month sheets are deleteded and the two sheets containg the employee data are cleared from row 2 down (leaving the headers) then the
4. All named ranges are reset (deleted and then reassigend)
5. File saven again
6. 12 new month sheets are created for in this case 2013 with the related formatting like Holidays, weekends etc.
7. File saved again 
8. And it's ready to work with.*

If I now close the file and then reopen it the message is dispalyed. No error as it seems, at least if I interpret what the message tells me.

I did a small test, entered the some text in row 2 of main employee sheet (which is an employee name) and saved and closed the file.

Reorpend it and no more problems.

It is back to debugging to find out why since I do not address andy employee I just check if row 2 is empty so that either this sheet is displayed of the month sheet.

The issue as posted is solved so I will close it but the reason it throws the warning if row 2 of sheet is empty and that "If I trust the contents", Well Microsoft really makes it hard for prgrammers to read between the lines to see what they really mean.

Thanks 20_2_Many for having read through all the stuff I wrote and taken the time to post, but it did drive me nuts until late this afternoon.

I'll update the call even if it's marked solved just for the curious ones amongst us.


----------



## Keebellah (Mar 27, 2008)

I did just as I said.
I still haven't found why it triggers the Warning if I trust this sheet and so but ...
What I do now is that when I close the sheet and the employee sheet is still empty I place the text "Dummy" in cell A2

When opening the file it now works normally and the the first cell in the employee sheet A2="Dummy" I clear the cell

It's a workaround and it works


----------



## Garf13LD (Apr 17, 2012)

The "zip" file gets corrupted over time.
This happens to me a few times.
I haven't found the cause or solution to it.
What I did is to press F12 to save as, and things should get going again.
I think there was one or 2 instances where it prompt to wipe out saved values, lucky the macros and codes are intact after clicking "yes".

There was one instance recently where all of a sudden, the file force close when macro was activated: and F12 cannot solve the problem.
I have forgotten how I solve that problem, but I know I have to disable macro to open that file and did some "magic" to it.


----------



## Keebellah (Mar 27, 2008)

The strange thig is, that if I do not place the "Dummy" in cells A2 if throws the error and after opening with Ýesy" and reinstatng the libne of code to place'" Dummy" it works so it isn't really the zip itself but what is it doing when opening and 'extracti'ng" I wish Microsoft support would at least react on this but it's a great silence on their side.

Thanks anyway for looking too.


----------

