I'm not sure what the cause is. Maybe the 4 different files were based on one
workbook that was "close" to being corrupted (whatever close means).
And the others were based on a different workbook.
Or maybe something bad happened when the file was sent???
The only time I've seen a corrupt workbook had one worksheet that was bad. I
could remove that worksheet and rebuilt it and then everything went back to
being ok.
I don't know what caused it, but there were lots and lots of comments and lots
and lots of different formatting. So I stay away from using those features (to
excess, that is).
Barb Reinhardt wrote:
>
> Dave,
>
> I've seen 4 different files from the same individual show at one time as
> corrupt. Could this be a problem with his installation of Excel or
> something else? I've not seen any others that are corrupt and I've probably
> extracted data from 2000 workbooks over the last 2 years.
>
> Thanks,
> Barb
>
> "Dave Peterson" wrote:
>
> > I'd ask the sender to resend those troublesome workbook files.
> >
> > Maybe the workbook is on the "cusp" of corruption and only causes problems
> > sometimes????
> >
> > Maybe you could try opening (and saving as a new name on different pc's--or even
> > in different versions of excel).
> >
> > Or maybe you could try openoffice:
> > http://www.openoffice.org, a 60-104 meg download or a CD
> >
> > It's been known to save both data, formatting, and code from files that excel
> > couldn't.
> >
> > Barb Reinhardt wrote:
> > >
> > > 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
> >
> > --
> >
> > Dave Peterson
> >
--
Dave Peterson