Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have an excel file that I use to print 4 documents for each lin (5000) in the Excel worksheet. This entire action is automated via VBA code. The first two document printed are Excel worksheet documents, the 3rd is an MS Word file, an the 4th is an Excel worksheet document. I wrote the initial application is Office 2002 and it works fine i 2002. I am now required to make it work in Office 2000, but crashes M Word in Office 2000. The MS Word document contains field codes that are updated fro specific cells in the Excel Worksheet. MS Word Print Options are se to Update Links, Update Field codes, and no background printing. The first 6 Excel lines process fine beofe MS Word crashes. I receiv a message "MS Word for Windows has encountered a problem and needs t close:" The Error code is: AppName: winword.exe AppVer: 9.0.0.3822 Offset: 000f3a53. Excel has a window open indicating that "Microsoft Excel is waiting fo another application to complete an OLE object". Click "Send" or Don' Send" in the MS Word error closes Word, and Excel then produces run-time error '-2147023170 (800706be)' Automation error The remot procedure call failed. The debug line reads as follows: wdApp.activedocument.PrintOut Background:=False, Copies:=1 Collate:=True My entire Excel vba word code looks like this: Dim wdApp As Object Dim wdDoc As Object Set wdApp = CreateObject("Word.Application") Set wdDoc = wdApp.documents.Open("C:\FormR1.doc") Do Until Worksheets("DB").Cells(i, 1).Value = "" Worksheets("AddrSheet").Activate ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True Worksheets("Cover").Activate Application.CalculateFull ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True wdApp.activedocument.PrintOut Background:=False, Copies:=1 Collate:=True Worksheets("FormA").Activate ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True i = i + 1 Loop Any ideas why this crashes -- alruf ----------------------------------------------------------------------- alruff's Profile: http://www.excelforum.com/member.php...fo&userid=1500 View this thread: http://www.excelforum.com/showthread.php?threadid=26623 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Word and Excel crash when I try to open a folder to get to a file | Excel Discussion (Misc queries) | |||
excel and word crash | Excel Worksheet Functions | |||
Embedding Word Docs into Excel Worksheets and Then Printing The Word Docs | Excel Worksheet Functions | |||
Printing Word Document using Excel Programming hangs Word | Excel Programming | |||
Printing Word doc from Excel | Excel Programming |