View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Eric Li Eric Li is offline
external usenet poster
 
Posts: 1
Default unexpected error (32809)

I am having the same issue with Excel VBA code.
I have a workbook that has 27 worksheets. (24 worksheets are either
blank or have text/numeric values, no formulas)
I'm using Excel 2003 (11.8117.8107) SP2 on Windows 2000.

As the other poster mentioned, the workbook is inconsistent with this
error. Sometimes it's fine, othertimes it crashes.

My first sheet has five command buttons and three checkboxes. One of
the checkboxes is named "chkDelFile1" .. on occasion the VB Editor will
say "Method or data member not found" when referring to
sheet1.chkDelFile1, which is not the case.

The second sheet has 720 calls to a function macro called "getData()"
which is located in a standard Module.

The code also connects to Outlook, enumerates the Inbox, downloads an
email attachment and opens another Excel workbook (which has no macros
of its own.)

On occasion, when the workbook opens, it gives the error "Type Mismatch
Error" (this will often be an indicator that Excel will crash; sometimes
when the workbook is Recovered & Repaired, the macros are stripped from
it.) Other times it gives the 32809 error, and then automatically
enters a breakpoint at the getData() function. Macro security is set to
"Medium."

The "Type Mismatch Error" will let me continue to use the workbook. The
32809 error will stop the macros cold.

I suspect that the workbook is corrupt in some way, and I plan to
copy-paste everything to a new one.

*** Sent via Developersdex http://www.developersdex.com ***