Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old February 10th, 2005, 02:25 PM
big_riki big_riki is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 3 big_riki User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 27 m 51 sec
Reputation Power: 0
Smile accessing existing object/process

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

Reply With Quote
  #2  
Old February 17th, 2005, 09:34 AM
big_riki big_riki is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 3 big_riki User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 27 m 51 sec
Reputation Power: 0
Bump.

Does anyone know how to or have any suggestions/alternatives?

Reply With Quote
  #3  
Old February 17th, 2005, 09:53 AM
Memnoch's Avatar
Memnoch Memnoch is offline
Unholy Moderator
Click here for more information.
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,781 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 8 h 45 m 55 sec
Reputation Power: 470
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.

Reply With Quote
  #4  
Old February 17th, 2005, 05:00 PM
big_riki big_riki is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 3 big_riki User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 27 m 51 sec
Reputation Power: 0
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...

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > accessing existing object/process


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT