Sometimes when I print a certain word document from Excel using VBA it does not print until I manually activate the Excel window. Most of the time it works. The code is:
While mywordclass.wordapp.Application.BackgroundPrintingStatus <> 0
printing = False
If mywordclass.wordapp.Documents.Count = 0 Then
Set mywordclass = Nothing
AppActivate "Microsoft Excel - " & ThisWorkbook.name
This is the class module code:
'printing' is a public variable, so it is false when the above sub is called.
N.B. Since this an intermittent problem I will not pay until it is verified the solution works which may take several weeks.