|
-
Sep 20th, 2005, 07:04 PM
#1
Thread Starter
Addicted Member
Handling Excel dialog boxes
I have written an enterprise level utility whose sole purpose in life is to seek out Excel and Visio documents and alter their paper sizes based on criteria specified in a configuration file (per my customers request).
The utility performs surprisingly well on Office XP and Office 2003. In Office XP and above, there is a method called EnableEvents (True / False) that determines whether or not macros fire. For obvious reasons, when the program is going through 10,000+ files, you do not want the macros executing.
However, on Office 2000, this method does not exist. As a result, you cannot prevent the macros from executing. Furthermore, if you try and trick the system by raising the security level of Excel to high for macros temporarily, the macros still execute as the documents are opened programmatically and as such inherit the trust given to the application that called it. This is a bad design and I have already submitted a request to change this behavior in future versions of Office as the behavior exists to this day.
I have been working an SRX with MS Dev's for a few weeks now on a solution to this problem and every solution we have come up with has hit one wall or another.
So I had a new thought that I want to test, but I have never done anything like it so I need some help getting started. The one document in particular that is causing problems is a time card that has several dialog box prompts. Now, regardless of what you answer (Y, N, Cancel, etc...), as long as you navigate through them, my program continues to execute.
What I would like to do is handle the dialog boxes and pass values to them. I have done some reading up on SendKeys, but I am unsure on how to implement them in my code.
Keep in mind that this one particular document has 3 "y/n" / OK dialog boxes in it so I need to be able to handle multiples.
Thank you for any assistance you can provide.
Jim
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|