|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I've written a .vbs file to convert a word file to a pdf file. It works great but now I want to make it run faster. Currently,
it runs around 5 seconds for a single page word file, but 2.5 of those seconds are where I create the word object, ex Set variable = CreateObject("Word.Application"). Everytime I run the vbs script it creates an instance of the word object then closes it at the end of the file. Does anyone know of a way to create it once, then if the script runs again, find that word object again and re-use it? Anything would be helpful. Thanks |
|
#2
|
|||
|
|||
|
Bump.
Does anyone know how to or have any suggestions/alternatives? |
|
#3
|
||||
|
||||
|
It's better to do it the way you are doing it.
Create the object, use it, then destroy it. Otherwise the object just sits in memory and takes up space and processing power. |
|
#4
|
|||
|
|||
|
Yeah, That's what I believe too, but this process will sit in between two other ones and I'd rather have extra time than cut it close before the next process takes the pdf file and does whatever. Is there a way to create a "service" or something or refer back to the instance of the COM object?
I know converting pdfs take awhile but I can save 30% of the time by not creating and destroying the word object. Thanks for your thoughts anyways... |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > accessing existing object/process |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|