Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Re: excel automation

Reply
 
Old 08-21-2009   #1 (permalink)
mr_unreliable


 
 

Re: excel automation



Wolf Grossi wrote:
Quote:

> doing excel automation I'm running into the problem that a maro inside
> some excel files can throw a
> 'Microsoft Visual Basic/Runtime error' messagebox.
>
> As this happens in an automated process I want to prevent the
> excel-macro from sending message boxes, maybe something similar to the
> excel object attribute excel.DisplayAlerts = False.
>
> I have no access to the execl files being processed, so I must handle
> either the behavior of the excel macro or use some kind of 'hit the
> button' function (AutoIT comes in mind), but I'd prefer doing this
> within the VBScript.
>
hi Wolf,

We may have to dig a little deeper into your script.

For example, if the macro is set up to run when you open your
worksheet, then there's not much you can do -- other than
react to the error dialogs.

OTOH, if you start the XL app and then run the macro later,
then you may have an opportunity to suppress the error dialogs.

I have never used the display alerts property, as I prefer to
get the vba errors out of the macros before using them in
production. And so, I am wondering whether you will be doing
yourself a favor by suppressing the error dialogs. In other
words, if there is really a "runtime error", then something
the original programmer was trying to do -- just isn't working.
And charging ahead anyway will get you what???

As far as reacting to error dialogs, it is "possible" in vbs,
by using appactivate to check if the dialog is showing and
sendkeys to close it. However, you would be much better off
using some other scripting language (like AutoIt3, or many
others) which will give you more control over what you want
to do than appactivate and sendkeys.

cheers, jw
____________________________________________________________

You got questions? WE GOT ANSWERS!!! ..(but, no guarantee
the answers will be applicable to the questions)

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Excel Automation - Determine the Columns Selected .NET General
Slow Excel Automation PowerShell
Excel does not die using automation .NET General
Vista ASP.NET 2.0 Cannot open Excel File using Microsoft.Excel 12.0 COM object Microsoft Office
Excel automation PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46