Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel automation and procedures
Message
From
20/03/2018 15:17:59
 
 
To
20/03/2018 14:05:04
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01658838
Message ID:
01658867
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.

BTW, the slow closing happens only on some machines, and only if there is no internet connect. I could not find any specific reason for that. The only cure might be re-installing Office and/or Windows, but that same problem could of course occur at a client, so that would not really be a solution we could offer.
Christian Isberner
Software Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform