Larry Linson wrote:[color=blue]
> Best information and links on corruption and trying to fix it that I
> know about are at MVP Tony Toews' site,
>
http://www.granite.ab.ca/accsmstr.htm. Take a look at those.
>
> I never heard of using an Excel library of any version causing
> database corruption. There are many causes, but that'd be a new one
> on me.[/color]
Well, I had been working with and in a code block that uses the Excel
automation object when the corruption occurred.
Here's the automation code that runs fine once, but usually leaves the Excel
instance open in memory (use Task Mgr | Processes | End Process to close
it). The next time you try to run it, it crashes on
'objWB.Worksheets(1).Activate' (halfway down)
Dim objExcel As Excel.Application, objWB As Excel.Workbook, objWS As
Excel.Worksheet
Set objExcel = New Excel.Application
Set objWB = objExcel.Workbooks.Open(chosenFile)
For Each objWS In objWB.Worksheets
With objExcel
... do things with the sheet
End With
Next objWS
'LEAVE CURSOR IN A1 BEFORE SAVING SHEET
objWB.Worksheets(1).Activate
objWB.Worksheets(1).Range("A1:A1").Select
objWB.Worksheets(1).Range("A1").Activate
objExcel.ActiveWorkbook.Save
'CLOSE OBJECTS
Set objWS = Nothing
objWB.Close
Set objWB = Nothing
objExcel.Quit
Set objExcel = Nothing
[color=blue]
> Larry Linson
> Microsoft Access MVP
>
> "DFS" <nospam@nospam.com> wrote in message
> news:10juodjqpddjs3a@corp.supernews.com...[color=green]
>> "[database name] has detected corruption in this file. To try to
>> repair the corruption, first make a backup copy of the file. Then,
>> on the Tools menu, point to Database Utilities and click Compact and
>> Repair database. If you are currently trying to repair this
>> corruption then you will need to recreate this file or restore it
>> from a previous backup."
>>
>> I think it's my usage of the Excel 9.0 object library that's causing
>> the problem, but I can't be sure.
>>
>> It's a corruption in one or all of the modules. None will open.
>>
>> I can put forms in design mode, but can't add objects to them. I can
>> sometimes open tables.
>>
>> None of the usual repair / recovery methods works:
>> * Compact and Repair
>> * create new db and import objects
>> * delete non-corrupt module, Compact and Repair
>> * export modules to another file
>>
>>
>>
>> Any ideas?
>>
>> Thanks[/color][/color]