Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel automation and procedures
Message
 
To
21/03/2018 08:06:48
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01658838
Message ID:
01658905
Views:
48
>>>> Tamar, It was your book that allowed me to start automating excel. I am using different tabs and procedures because I use one procedure to, for instance, make one histogram showing numbers of A', the same procedure to make a pivot table, showing the # of A's per year, etc. What do you mean, where is it in your book, when you tablk about using a property of either a dedicated automation object or the application object. I missed this part, somehow. But your book is in front of me.
>>>>
>>>
>>>This paragraph is near the end of the Introduction:
>>>
>>>"For larger examples, we had to make a choice. In real applications, you almost always want to open the Automation server, do what needs to be done, and close the server. In that situation, you can use a local variable to hold the reference to the server. For our purposes, however, we usually want the server to stay open and accessible following the example so that you can examine the results and reference the server from the Command Window. However, we didn’t want to leave multiple instances of the servers running, abandoned and using your system resources. So most of the examples that are included in the Developer Downloads clear any variables that might be references to Automation objects, and then create a public variable to reference the server. We do not recommend using this technique in your applications."
>>>
>>>And most of the examples that declare a public variable, include a comment about it being for demo purposes. In addition, Chapter 15 talks about building a class to wrap the servers and shows how to set up the reference in a property.
>>>
>>>Tamar
>>
>>I was just working on an application with automation functionality, and we have quite some performance issues, especially when closing the Word server it sometimes takes up to 10 seconds to finalize the quit command. Therefore I am now thinking to change it so the application instantiates the server at the first access and then keeps reusing the server until the application closes and then we can force a task kill. What do you think about this approach, since I just read you would rather open and close the server at demand. What it does now in our application, it processes several Word documents and with each document it instantiates and closes the Word server.
>
>I've changed my mind on that part since I wrote that in 2000. For an application that does repeated automation, I open the server the first time I need it and keep it open.
>
>Tamar


I am opening up a Word doc, and two different Excel workbooks. GetObject will find at least one of each. Since I was developing my project, I needed a quick way to close all open word or excel processes. Since GetObject was not working (I will try again re the "," mentioned above'), I resorted to a task kill statement since it always works. I suppose if I used a wrap around server as Tamar metions, that might handle all of the processes that I open and therefore require a single release to close them all.

In the meantime, does anyone know how to suppress the flashing DOS screen that of course goes along with using task kill? Thanks so much, Steve
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform