Re: how to code printing in excel

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Chad DeMeyer (cjdemeye_at_bechtel.com)
Date: 06/01/04


Date: Tue, 1 Jun 2004 14:44:25 -0700

Unfortunately, the Dialog object in Excel has no Display method. Only the
Show method is provided.

Regards,
Chad

"qlueless" <anonymous@discussions.microsoft.com> wrote in message
news:9A3C5C28-55E0-4B00-A7CF-43D759EAC675@microsoft.com...
> My com add-in is to handle customized printing in Word and Excel.
> I have no problem with Word but cannot find anything workable for Excel.
> Here is the code snippet:
>
> If app = "Microsoft Word" Then
> Set dlg = app.Dialogs(wdDialogFilePrint)
> ElseIf app = "Microsoft Excel" Then
> Set dlg = app.Dialogs(xlDialogPrint)
> End If
>
> If dlg.Display = -1 Then
> Dim doc As Object
> If app = "Microsoft Word" Then
> Set doc = mclsAccess.AppInstance.ActiveDocument
> ElseIf app = "Microsoft Excel" Then
> Set doc = mclsAccess.AppInstance.Active***
> End If
> doc.PrintOut PrintToFile:=dlg.PrintToFile
> End if
>
> When I invoke the print in Excel
> I am getting Error 438 (Object does not support this property or method)
> but I cannot find anything that works.
>
> Any help will be greatly appreciated.


Quantcast