Excel cannot open .xls file
Hi
Got a new customers pc here. she had a virus last week (one of the ucash ones) . she then ""spent all day trying to fix it following instructions on various forums""
She has no idea what she actually did. the virus isnt there anymore, but now nearly nothing works on the pc. sys restore doesnt work and every single document is giving me the error ""the open office xml file xxxx.docx cannot be opened because there are problems with its contents"" details: ""the file is corrupt and cannot be opened"". this also happens with xls, xlsx, docx, doc, csv
The files dont open on my work pc either.
so far i have got the data off her disk and tried:
1) open and repair in word / excel
2) renaming as a .zip and then trying to extract it (doesnt work, zip file says it is empty) to get at the xml
3) running checkdisk on the disk and then trying to open on both her and my pc
4) using open office to open the files
All have failed. i have run out of ideas.
So i would like to know if there is any software i can buy that will bulk sort out all her docs, or if anybody has an idea as to how to get these to open.
Thanks for your help!
- melvin88's blog
- Login or register to post comments
- 11796 reads
Excel cannot open .xls file
Try this script:
'--------------------------------------------------
Option Explicit
Dim objExcel
Dim ExcelVersion
Dim regVersionKey
Dim dwValue
Dim strVersion
Set objExcel = CreateObject("Excel.Application")
ExcelVersion = objExcel.Version
strVersion = Mid(ExcelVersion,1,4)
Select Case strVersion
Case "12.0"
regVersionKey = "12.0"
SetRegValue
Case "14.0"
regVersionKey = "14.0"
SetRegValue
Case "15.0"
regVersionKey = "15.0"
SetRegValue
Case Else WScript.Echo "The script can not find proper office version."
End Select
Set objExcel = Nothing
Sub SetRegValue
Dim objRegistry
Dim strKeyPath
Dim strComputer
Dim strValueName1,strValueName2,strValueName3
Const HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
' sets the value of registry
dwValue = 1
'Define a key registry path
strKeyPath = "Software\Microsoft\Office\" & regVersionKey & "\Excel\Security\"
strValueName1 = "DisableInternetFilesInPV"
strValueName2 = "DisableAttachmentsInPV"
strValueName3 = "DisableUnsafeLocationsInPV"
'Create the key of registry
objRegistry.CreateKey HKEY_CURRENT_USER,strKeyPath & "\ProtectedView"
'Setting the value of registry
objRegistry.SetDWORDValue HKEY_CURRENT_USER,strKeyPath & "\ProtectedView",strValueName1,dwValue
objRegistry.SetDWORDValue HKEY_CURRENT_USER,strKeyPath & "\ProtectedView",strValueName2,dwValue
objRegistry.SetDWORDValue HKEY_CURRENT_USER,strKeyPath & "\ProtectedView",strValueName3,dwValue
'Outputs the execution information.
WScript.Echo "Successfully fixed Excel file corrupted error."
End Sub
this morning i also got stuck
this morning i also got stuck with something like this and its turning the xls, xlsx, docx, doc, csv in to .txt format.
looking for it, would come back here for the answer!!