I am having difficulty with the Application.PrintCommunication property with early binding.
In the code below, the first DirectCast statement executes without any issues but the second DirectCast statement raises a COM error.
Code:
DirectCast(xlSheet.PageSetup, Excel.PageSetup).Application.PrintCommunication = False
With CType(xlSheet, Excel.Worksheet).PageSetup
.PrintTitleRows = "$1:$1"
.PrintTitleColumns = ""
.PrintArea = ""
End With '...PageSetup
'...setting PrintCommunication property to TRUE raises a COM error
DirectCast(xlSheet.PageSetup, Excel.PageSetup).Application.PrintCommunication = True
The error is "System.Runtime.InteropServices.COMException", which is not very helpful
Any insight/guidance on how to set the PrintCommunication property to True will be much appreciated.