Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
My wife is an analyst with a very large company. She has recently changed
groups within the company and inherited responsibility for about 400 worksheets, each of which contains a Validate subroutine. She's a good programmer -- comp. sci. from Cornell; C doesn't scare her -- and she's been cleaning up and extending Validate for the past few weeks. Now she's doing testing for a new release. All 400 worksheets will be rolled out to the users at once tomorrow, with the new Validate code in place. Except...she ran one test too many. Here's the e-mail I got: I have an Excel "template" spreadsheet which has several macros associated with it. In particular, there's a subroutine StandAloneValidate, which is associated with a shortcut key, which has 3 lines of code: Dim RC as Boolean Call Validate(RC) End Sub The Validate subroutine has lots of logic, calls several functions, etc. I've added lots of functionality to it in the last few weeks. It's been working nicely. Today something odd happened: I did a bunch of testing with spreadsheets that had just been created/updated with the VBA in my template spreadsheet. They worked correctly. I edited the VBA code throughout to add comments -- nothing more. I brought this updated code into my "test" spreadsheet. I ran the StandAloneValidate macro. I got an error on the Call Validate(RC) line of code; the error occured on the return from the Validate subroutine. I didn't write the error down, but it was something about a problem calling a DLL function. The error occured both from running the code in the VBA environment, and running it from the spreadsheet using the shortcut key. Rebooting didn't help. I renamed the Validate subroutine to ValidateData, and the problem went away. I renamed it back to Validate just to see -- well, just to see. Ran just fine. No problem. Now I can't reproduce the error. Going back to an older version of the code and pasting in my edits doesn't cause the error. (I didn't save a copy of the spreadsheet when it was causing the error!) Any idea what caused my error? Any idea of if it will recur, or how I can prevent it from recurring? Any thoughts at all? The real problem here is that my wife's boss is from the mainframe world, doesn't understand that Windows programs just do this sort of thing sometimes. He reasons -- logically -- that if it happened during testing, it can happen during deployment. The fact that my wife has now tested her code on all 400 worksheets -- repeated all her regression testing -- doesn't impress him. The code failed once, after all. And no one knows why. So no one can say that it won't happen again. That's his position, and of course it's reasonable. But...this is a first major project for my wife, so she is undergoing some evaluation. Excel/VBA are undergoing ongoing evaluation, as is, I suppose, the Windows platform itself. Excel is too good a tool to fail this test...and yet, the boss's request for an explanation of the error is reasonable. (Yes, we'll be making screen shots of error messages from now on. Whoops.) -- Every normal man must be tempted, at times, to spit on his hands, hoist the black flag, and begin slitting throats. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
ANALYST TOOL PACK -- #VALUE! | Excel Worksheet Functions | |||
An Interesting vba Excel quirk | Excel Discussion (Misc queries) | |||
Crime Analyst needs help with co-ordinates | Excel Discussion (Misc queries) | |||
newbie seeks excel help - please!! | New Users to Excel | |||
Installed Analyst Toolpak but not working for files used at work? | Excel Worksheet Functions |