View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Printer name from handle

Perhaps you can use this. It will set the printer.

application.Dialogs(xlDialogPrinterSetup).Show

--
Regards,
Tom Ogilvy

"Eje" wrote in message
...
I need the printer name to printout an Excel worksheet.

CommonDlg returns a handle to the chosen printer while
the printout command needs the printername. The "newer"
PrinterDlg may return the printername but instead needs a
handle to a window. What window is unclear. User32.dll
can return a window's handle but need a frameclass which
a can't find.