Yan_A
02-26-2018, 03:22 AM
Hello,
I have some files that when I manually try to open them come up with the below message:
Excel found unreadable content in "***.xlsx". Do you want to recover the contnents of the workbook? .....
When I click YES it shows me the below:
Excel was able to open the file by repairing or removing the unreadable content.
Removed Feature: Data validation from /xl/worksheets/sheet1.xml part
And then I can manually save it, replace it, and the file thereafter opens normally with no errors.
Now my problem is... I want to do the same with a VBA code...
I prepared the below and there is no luck... It comes with 1004 error:
Sub letshope()
WithApplication
.DisplayAlerts=False
.ScreenUpdating=False
.EnableEvents=False
.AskToUpdateLinks=False
EndWith
Set wb =Workbooks.Open(Filename:= _
"\\folder\***.xlsx", _
UpdateLinks:=0,Password:="password", _
IgnoreReadOnlyRecommended:=True, _
CorruptLoad:=XlCorruptLoad.xlRepairFile)
EndSub
Unfortunately everybody on the web suggests that with the "CorruptLoad:=XlCorruptLoad.xlRepairFile" part all corrupted files open...
This is not the case...
Anyone who might have any kind of idea please?
It is a painful process opening them manually, saving them etc....
Once I manually open them and press to recover they all come up with the same error:
error067760_07.xml
Errors were detected in file '******.xlsx'</summary>
-<removedFeatures summary="Following is a list of removed features:">
<removedFeature>Removed Feature: Data validation from /xl/worksheets/sheet1.xml part</removedFeature></removedFeatures></recoveryLog>
Thanks!!!
I have some files that when I manually try to open them come up with the below message:
Excel found unreadable content in "***.xlsx". Do you want to recover the contnents of the workbook? .....
When I click YES it shows me the below:
Excel was able to open the file by repairing or removing the unreadable content.
Removed Feature: Data validation from /xl/worksheets/sheet1.xml part
And then I can manually save it, replace it, and the file thereafter opens normally with no errors.
Now my problem is... I want to do the same with a VBA code...
I prepared the below and there is no luck... It comes with 1004 error:
Sub letshope()
WithApplication
.DisplayAlerts=False
.ScreenUpdating=False
.EnableEvents=False
.AskToUpdateLinks=False
EndWith
Set wb =Workbooks.Open(Filename:= _
"\\folder\***.xlsx", _
UpdateLinks:=0,Password:="password", _
IgnoreReadOnlyRecommended:=True, _
CorruptLoad:=XlCorruptLoad.xlRepairFile)
EndSub
Unfortunately everybody on the web suggests that with the "CorruptLoad:=XlCorruptLoad.xlRepairFile" part all corrupted files open...
This is not the case...
Anyone who might have any kind of idea please?
It is a painful process opening them manually, saving them etc....
Once I manually open them and press to recover they all come up with the same error:
error067760_07.xml
Errors were detected in file '******.xlsx'</summary>
-<removedFeatures summary="Following is a list of removed features:">
<removedFeature>Removed Feature: Data validation from /xl/worksheets/sheet1.xml part</removedFeature></removedFeatures></recoveryLog>
Thanks!!!