View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Evan McC Evan McC is offline
external usenet poster
 
Posts: 2
Default Workbooks Open = different result than actually opening Workbo

Thank you for the response, Halim.
Not posting code was a deliberate decision. For one thing, I don't have a
specific error at a specific point and entire Project is too much to post.
Fundamentally, opening the workbook and running the Workbook Open event code
from inside the VBE should produce the same result (assuming no changes to
the workbook, and I'm confident there are none in this case -- if there were
changes, they'd result from the Workbook Open event code, and I'd see
different output *every* time). I don't see how that can be code-dependent.
It's the same code, with the same data, running under slightly different
conditions. To me, that indicates the problem's in the slightly different
conditions, not in the code.

Regardless, thanks again for your response.
-E.
--
Today is not the worst day of my life.


"Halim" wrote:

hi,
do you have a code to show?
post the code and other poster will see and help
--
Regards,

Halim



"Evan McC" wrote:

Excel 2003 (Standard) SP2, Windows XP Pro SP2

My project, essentially, searches a 1500 row by 50 column spreadsheet for
keywords and stores values for a half-dozen-or-so cells in an array of
User-defined type. The keywords are loaded into a listbox, the user picks
1-or-more, and data about cells related to those keywords is extracted from
the array.

Here's the thing: Sometimes (*not* repeatably), when I open the workbook and
select from the listbox I get results that are slightly incorrect (e.g., a
keyword actually occurs 56 times, but is reported to occur 52 times). If
open the VBE and run the Workbook Open code, I get the correct result.

The only explanation I can generate, and I grasp at a straw here, is that
the spreadsheet is so laden with formulas (the root of the project is to
speed it up by converting major portions to code) that initial calculation is
interfering with my code. But there's a problem with that theory. I can
trigger the control again, and still get a bad result.

If anyone has any ideas, I'd really like to hear them. Thanks.
--
Today is not the worst day of my life.