Strange Office Automation Errors/Problems
Strange Office Automation Errors/Problems
Strange Office Automation Errors/Problems
Strange Office Automation Errors/Problems
Strange Office Automation Errors/Problems
Strange Office Automation Errors/Problems Strange Office Automation Errors/Problems Strange Office Automation Errors/Problems Strange Office Automation Errors/Problems Strange Office Automation Errors/Problems Strange Office Automation Errors/Problems Strange Office Automation Errors/Problems Strange Office Automation Errors/Problems
Strange Office Automation Errors/Problems Strange Office Automation Errors/Problems
Strange Office Automation Errors/Problems
Go Back  Xtreme Visual Basic Talk > > > > Strange Office Automation Errors/Problems


Reply
 
Thread Tools Display Modes
  #1  
Old 12-29-2002, 05:45 PM
dwflood100
Guest
 
Posts: n/a
Default Strange Office Automation Errors/Problems


Hello and thanks for your brain power.

I am quite proficient with Office Automation for 2000 and XP versions of Office. Here is the scenario and the problem that is just blowing me away.

We use word documents to create sales tickets, reports, etc that are printed using Office Automation print commands. Recently, we had a sever computer crash and the Automation procedures no longer run smoothly. During print out, I am asked if I am sure I want to quit Word as doing so will cancel my print job. Pre-crash, the system ran smoothly and clean.

The OS is Windows 2000 Pro which was reinstalled and all pre-existing software was readded. The VBE 6.0 software was reinstalled and the source code for our application recompiled. I received no errors during the loading (opening) of the source code nor during the compile. However, whether the code is ran from the VB IDE or as an EXE, the same errors occured.

At first we felt it may have been hardware issues. So we tried an a new machine. I then thought it may have damaged my source and checked all 27,000 lines over a week.

Am I missing something? I even tried to shut off the alerts tag in word. Didn't work. I've reached my wits end.
Reply With Quote
  #2  
Old 12-30-2002, 05:25 AM
Timbo's Avatar
TimboStrange Office Automation Errors/Problems Timbo is offline
Green-Eyed

Super Moderator
* Guru *
 
Join Date: May 2001
Location: Bangkok, Thailand
Posts: 10,261
Default

Have you traced the line of code where the error occurs?..
__________________
"He's not the Messiah. He's a very naughty boy!" - Brian's mum

Can't find the answer? >> Try something new!
Become a Professional
Reply With Quote
  #3  
Old 01-04-2003, 08:09 AM
dwflood100
Guest
 
Posts: n/a
Unhappy Tried tracing the code at the error.

The problem herein lies is the error is generated somewhere between my application and word. The Automation Procedure never changed. Just the execution. One day the automation was smooth the next it wasn't.

I did, however, try to upgrade to Word XP from Word 2000. Is there a chance that some of the residual installation information from both applications is interfering with each other?

I just don't get it. uhhu uhhu.
Reply With Quote
  #4  
Old 01-05-2003, 06:23 AM
Timbo's Avatar
TimboStrange Office Automation Errors/Problems Timbo is offline
Green-Eyed

Super Moderator
* Guru *
 
Join Date: May 2001
Location: Bangkok, Thailand
Posts: 10,261
Default

Quote:
During print out, I am asked if I am sure I want to quit Word as doing so will cancel my print job.
ok, well which line does that bit come up on (+ related declarations/code)...
__________________
"He's not the Messiah. He's a very naughty boy!" - Brian's mum

Can't find the answer? >> Try something new!
Become a Professional
Reply With Quote
  #5  
Old 01-05-2003, 09:35 AM
dwflood100
Guest
 
Posts: n/a
Default

Here is the block of related Code:
--------------------------------------------------------------
Set PawnTicketDoc = CreateObject("Word.Application")
PawnTicketDoc.Documents.Open FileName:="C:\BLPAWNSYS1.0\nfo1033\completePawnTicket.doc"
PawnTicketDoc.Application.DisplayAlerts = wdAlertsNone
PawnTicketDoc.Visible = False
Set MyActiveDoc = PawnTicketDoc.Documents("C:\BLPAWNSYS1.0\nfo1033\completePawnTicket.do c")
PawnTicketDoc.Application.DisplayAlerts = wdAlertsNone '**See below
With MyActiveDoc

PawnTicketDoc.ActivePrinter = DefaultPrinter
PawnTicketDoc.PrintOut Copies:=TicketCopies

End With

PawnTicketDoc.ActiveDocument.Close wdDoNotSaveChanges
PawnTicketDoc.Quit
Set PawnTicketDoc = Nothing
-----------------------------------------------------------------------------

The Code that is not listed here strictly selects and replaces various bookmarks with selected ADO records and User input information

The line [PawnTicketDoc.Application.DisplayAlerts = wdAlertsNone] was added when the problems began. This function works quite well in Excel to suppress all the related dialogs, but not in Word.

The DefaultPrinter variable is instantiated during the program startup from an INI file as is the TicketCopies variable. The actual error is being generated by [PawnTicketDoc.PrintOut Copies:=TicketCopies] which as I said was never an issue prior.

--------------------------------------------------------------------------
To recap:
Windows 2000 Crached.
The Windows 2000 Directory was deleted completely from Root.
Windows 2000 Was reinstalled.
Software was reinstalled in the following order.
1) Word XP instead of 2000 (the original copy used during prog. development)
2) Visual Studio Enterprise Complete Installation
3) Reinstallation of various OCX libraries
4) Attempted to Run Source Code from IDE
5) Didn't work, assumed 2002/XP was issues so Uninstalled.
6) Installed Office 2000 Pro complete Install
7) Issue Not Resolved.
Reply With Quote
  #6  
Old 01-06-2003, 04:37 AM
Timbo's Avatar
TimboStrange Office Automation Errors/Problems Timbo is offline
Green-Eyed

Super Moderator
* Guru *
 
Join Date: May 2001
Location: Bangkok, Thailand
Posts: 10,261
Default

I bet if you put a break-point on the line..

PawnTicketDoc.Quit

..and only run the code to there, you won't get the error.

Run a board search on "print job*"...
__________________
"He's not the Messiah. He's a very naughty boy!" - Brian's mum

Can't find the answer? >> Try something new!
Become a Professional
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Strange Office Automation Errors/Problems
Strange Office Automation Errors/Problems
Strange Office Automation Errors/Problems Strange Office Automation Errors/Problems
Strange Office Automation Errors/Problems
Strange Office Automation Errors/Problems
Strange Office Automation Errors/Problems Strange Office Automation Errors/Problems Strange Office Automation Errors/Problems Strange Office Automation Errors/Problems Strange Office Automation Errors/Problems Strange Office Automation Errors/Problems Strange Office Automation Errors/Problems
Strange Office Automation Errors/Problems
Strange Office Automation Errors/Problems
 
Strange Office Automation Errors/Problems
Strange Office Automation Errors/Problems
 
-->