B
Barb Reinhardt
For background, I run a data extraction from a repository monthly which opens
excel workbooks, extracts data and closes them. I've been doing this for at
least 2 years with no issues of corrupt files until recently.
Today I came across three workbooks that wouldn't open programmatically.
All come from the same individual. To complicate matters, the same
individual has submitted other files that open with no issue.
When I try to open the "corrupt files" using this syntax
Set oWB = XLApp.Workbooks.Open(newPath, UpdateLinks:=False, ReadOnly:=True)
I get the following error:
Run-time error '1004':
The document is corrupt and cannot be opened. To try and repair it, use the
Open and Repair command in the Open dialog (File menu) and select Extract
Data when Prompted.
When I open these files again directly from the source without the code, two
of them open with no problems. When I ran the data extraction again, these
same two files opened programmatically with no error.
No matter what I do with the third file, it always gives me a corrupt
message when it's opened.
I just discovered that another file that I didn't have problems opening this
month from the same source, was corrupt last month when I did this data
extraction. The common thread seems to be the source.
I'm kind of at a loss to know what to do next. I'm on 2003 and the source
is also on 2003. He's not converted to 2007. Has anyone else seen this
kind of behavior and if so, where should I go next?
Thanks,
Barb Reinhardt
excel workbooks, extracts data and closes them. I've been doing this for at
least 2 years with no issues of corrupt files until recently.
Today I came across three workbooks that wouldn't open programmatically.
All come from the same individual. To complicate matters, the same
individual has submitted other files that open with no issue.
When I try to open the "corrupt files" using this syntax
Set oWB = XLApp.Workbooks.Open(newPath, UpdateLinks:=False, ReadOnly:=True)
I get the following error:
Run-time error '1004':
The document is corrupt and cannot be opened. To try and repair it, use the
Open and Repair command in the Open dialog (File menu) and select Extract
Data when Prompted.
When I open these files again directly from the source without the code, two
of them open with no problems. When I ran the data extraction again, these
same two files opened programmatically with no error.
No matter what I do with the third file, it always gives me a corrupt
message when it's opened.
I just discovered that another file that I didn't have problems opening this
month from the same source, was corrupt last month when I did this data
extraction. The common thread seems to be the source.
I'm kind of at a loss to know what to do next. I'm on 2003 and the source
is also on 2003. He's not converted to 2007. Has anyone else seen this
kind of behavior and if so, where should I go next?
Thanks,
Barb Reinhardt