![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | 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. > 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 Specs![]() |
![]() |
| 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 | |||