Thanx Tom for your input, but 1st of all, apparently I am not the only one
having this problem (see the thread on "Let's try again: VBA Code stops
randomly");
secondly, when the code halts a dialog box appears stating "Code execution
has been
interrupted" with "Continue", "End", "Debug" buttons. This may not
technically "be an error", but it is "Not right". Selecting "Continue", or
selecting "Debug" and then F5 will continue execution normally to the next
randonm "Stop".
These stops could be anywhere along the program path and do not always occur
at the same point. For example in one run the program may stop at the call to
a function or sub, then at the start of a loop, then at a field calculation.
The next time it runs it may stop 10 times, but none of these stops at the
same places as in the previous run.
As for running code between applications, the KB has several examples of how
to open Access from Excel and vice versa, calling specific
macros/subs/functions. The current code begins in Access, then creates an
Object reference to Excel, opens a specific Excel Workbook and initiates code
within Excel, which pretty much begins by closing the Access database that
just called it then proceeds to execute. The "Before Close" even in that
Workbook then creates an object reference to Access, re-opens Access and
initiates code in Access which Closes the Excel workbook, then imports one
worksheet just created by the Excel subroutines. I've been using this type of
switch between apps since Office 97, and never had this kind of "Code
execution has been interupted" problem before.
I have experienced this "Error" when I've put Break Points in my code for
testing and then failed to remove them before saving. However, using the
Shift + F9 "Clear all breakpoints" and recompiling has always fixed this,
until now.
So, if you should come up with any other ideas or thoughts on what may be
causing this I'd appreciate hearing them.
Thanks again..
BAC
"Tom Ogilvy" wrote:
the reason is that Microsoft doesn't offer free support. You can contact
microsoft and open a support incident and pay for support. If it turns out
that the cause is a bug in the product, then you will not have to pay.
the reaons you probably aren't getting support is that the cause is more
than likely something to do with your code construction and not a known flaw
in excel.
for instance, this statement seems problematic:
In the middle of the Excel portion of the VBA (the calling Access file has
been closed)
If the code is in Access, then if you close the file, it seems natural the
code would halt. - but you said it worked in earlier versions, so if
absolutely no changes have been made, it isn't obvious what would cause this,
but support for automation has not changed in Office XP. Also, I suspect
that even Microsoft would be hesitant to try to debug a user built
application that automates between two products just because of the
complexity (unless you describe a known situation - not all of these are
documented in the knowledge base).
Also, you have described your code a halting (which is one type of problem).
Yet later you refer to an error message, but never say what the error
message is. Experiencing an error is a much differnt situation than code
halting with no indication of why.
--
Regards,
Tom Ogilvy
"BAC" wrote:
I have a problem that does not seem to be attracting an answer in the group
discussions from MVP's or others.
Why can't there be a "refer question to Microsoft" option/button somewhere
for when this happens? Or an option to refer to a specific MVP who may have
more contacts and knowledge of individuals who may have an answer?
See discussion "VBA Code stops randomly" and note that the 1st time I
submitted this questin i got no replies, but now I'm mostly getting others
who have the same proble, but no suggestion as to cause or fix!
thanx
BAC
----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.
http://www.microsoft.com/office/comm...el.programming