![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a package that runs every day and prints out a series of reports. The reports are generated into text files and printed by feeding the file name to a Word application object and then using the PrintOut method to print the file. I also select the printer. On occasion, say once or twice a month, I get the following error: Error Description: The remote server machine does not exist or is unavailable: 'appWord.Documents' Error on Line 162: Set objWord = appWord.Documents.Open(strFileName, False, True, , , , , , , , "Plain Text") I can't tell what the message means, as the file (strFileName) and the dts package are on the same computer. (the printer is on a remote computer). How can I make it more reliable? |
#3
| |||
| |||
|
| So I do a fair amount of cleaning up. I'll check again to see if any Winword. |
#4
| |||
| |||
|
|
Darren, Good thinking. The surrounding code that calls mcPrint looks like this: DTSGlobalVariables("InitialPrinter").value = appWord.ActivePrinter ConnectToPrinter (DTSGlobalVariables("Printer").value) appWord.ActivePrinter = DTSGlobalVariables("Printer").value WriteToLog "Changed Active Printer from " & DTSGlobalVariables ("InitialPrinter").value & " to " & DTSGlobalVariables("Printer").value, 1 mcPrint DTSGlobalVariables("FilePath").Value & DTSGlobalVariables ("FileName_1").value, DTSGlobalVariables("Printer").Value mcPrint DTSGlobalVariables("FilePath").Value & DTSGlobalVariables ("FileName_2").value, DTSGlobalVariables("Printer").Value mcPrint DTSGlobalVariables("FilePath").Value & DTSGlobalVariables ("FileName_3").value, DTSGlobalVariables("Printer").Value mcPrint DTSGlobalVariables("FilePath").Value & DTSGlobalVariables ("FileName_4").value, DTSGlobalVariables("Printer").Value appWord.ActivePrinter = DTSGlobalVariables("InitialPrinter").value WriteToLog "Changed Active Printer back to " & DTSGlobalVariables ("InitialPrinter").value, 1 appWord.Quit wdDoNotSaveChanges Set objWord = nothing Set appWord = nothing Set objNetwork = nothing WriteToLog "Quit Winword.", 1 So I do a fair amount of cleaning up. I'll check again to see if any Winword. exe's are left around, but my guess is that it's ok. If I don't use VBA what would I do? I need to send the reports to a printer, and the version of SQL Server/Windows that the production system is running on doesn't even have a printer object. In fact, if I allow the package to run under the System session, it can't see the printers at all. Regards, Edwin |
#5
| |||
| |||
|
|
Darren, Good thinking. The surrounding code that calls mcPrint looks like this: [quoted text clipped - 31 lines] Regards, Edwin You probably don't have much choice, as the alternatives would be far too much work, but the technology is not designed for the job, so it may have issues from time to time. Watch for the exe's, as I've found that to be an issue in the past. Rouge instances hang around and confuse things later. As I mentioned, kill.exe can be used to fix that quite well. |
#6
| |||
| |||
|
|
Darren, There are no Winword.exe's laying around on the server, at this time. Ofcourse it hasn't failed since June 30th. Where do I get Kill.exe? |
|
And then I would add a line something like "execute Kill.exe Winword"? To make sure there are none running when the dts package runs? Add a CmdExec step to the job or a Exec Proc Task to the start (and |
#7
| |||
| |||
|
|
Darren, There are no Winword.exe's laying around on the server, at this time. Ofcourse it hasn't failed since June 30th. Where do I get Kill.exe? Windows resource kit. Should be available to download on the MS site. And then I would add a line something like "execute Kill.exe Winword"? To make sure there are none running when the dts package runs? Add a CmdExec step to the job or a Exec Proc Task to the start (and maybe end) of the package. kill winword.exe |
![]() |
| Thread Tools | |
| Display Modes | |
| |