Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #16  
Old 11-11-2013, 03:31 PM
jdean jdean is offline Bulletted List Creation Windows XP Bulletted List Creation Office 2010 32bit
Novice
Bulletted List Creation
 
Join Date: Nov 2013
Posts: 14
jdean is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
I see that you have 'Set wrdApp = Nothing', but I don't see where you've terminated the wrdApp session (i.e. wrdApp.Quit). Not having that means you'll have an orphaned Word session floating around.

Hint: Since it seems you want your Word session to be running for multiple documents, you should start the Session independently of all the looping that opens the documents, then kill it once all the processing has been done. See, for example: https://www.msofficeforums.com/excel...readsheet.html
Macropod, I'm not sure if I want my word session to run for multiple documents necessarily. This is what is happening: If I run it, it applies the styles ok. I then manually either close or save the generated word doc. That is fine.
However, if I run the code a second time, just to see if I get the same results, that's when I get Run-Time Error '462': The remote server machine does not exist or is unavailable.



When I get this error, this part of the line is highlighted in yellow:

If bBulletA = False Then Call AddBulletStyle("BulletA", ChrW(61623), InchesToPoints(0), InchesToPoints(0.5), True)

I also suspected another instance of Word running, but I am a novice in Word VBA and wasn't sure how to handle it. Anyway, I placed "wrdApp.Quit" right before setting wrdDoc and WrdApp to Nothing in my code but the error persisted.
Also, when you say "start the Session independently of all the looping that opens the documents, then kill it once all the processing has been done," I don't think I start wrdApp or wrdDoc in a loop in my code above, so I am unsure what to do. So sorry to bother you this much but I am not that experienced in word vba.

I have an idea ... how about a code to check and close any open/orphaned Word session(s) before a new one is open each time the code runs?

Thanks!
Jay
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Calendar Creation sjvjoe Publisher 1 07-14-2016 06:32 PM
Bulletted List Creation Document Creation Privateer Word 3 06-20-2013 08:15 PM
Help with Complex Table Creation saquib Word 0 02-12-2013 06:28 AM
Bulletted List Creation Label Creation speloquin Word 1 05-27-2011 03:08 PM
Report creation. Igtech Excel 1 04-02-2010 03:33 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:40 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft