ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Detect more info when workbook does not ack right. (https://www.excelbanter.com/excel-programming/271406-re-detect-more-info-when-workbook-does-not-ack-right.html)

Tom Ogilvy

Detect more info when workbook does not ack right.
 
if the message is from an alert, then probably not. (or maybe you could
with extensive work in the Windows API, but I wouldn't know how to do
that).

If it is from an error message, then you can trap the error and record the
error information using the error object.

Regards,
Tom Ogilvy

"Tod" wrote in message
...
This is more of a scripting question, but I thought I'd
start here first.

I have several scheduled tasks. Each runs a vbscript. Each
script opens a workbook and runs a procedure in that
workbook that gets data from an Access database and
updates a sheet in the workbook then closes everything and
destroys the objects. The script ends by adding a line to
a text file that tells me the process ran and what day and
time. Ultimately I'd like to compile all of these scripts
into just one vb application, but as of today that's how I
do it.

Anyway. most of the time this all works fine. However
there are a couple of problems, and they seem related.
Sometimes I come in the next day and open one of the
workbooks that gets updated overnight and it tells me that
I already have the workbook open. But I don't. Something
must have happened during the script running. I just wish
it could tell me more about where the problem was
encoutered.

There is where my question comes in. Is there a way I can
have Excel notify my script if it is having problems and
have the script close everything down naturally. Then I'll
either know what was causing the problem, or could avoid
it all together.

Any thoughts?

tod





All times are GMT +1. The time now is 03:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com