Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ActivePrinter in Excel
Message
De
15/08/2001 06:24:55
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
15/08/2001 03:38:41
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00543937
Message ID:
00543953
Vues:
18
This message has been marked as the solution to the initial question of the thread.
>Hi,
>
>If I select a printer using getprinter() and then try to get Excel to print to this printer:
>
>lcPrinter=getprinter()
>oExcel.ActivePrinter=lcPrinter
>
>I will sometimes get an error message (Unable to set the activePrinter property)
>I tried recording a macro in excel and found out that Excel creates a command like:
>Application.ActivePrinter="//someserver/someprinter on ne3:"
>I have no idea where the ne3: comes from, but if cut this part in the recorded macro Excel will generate itself the same error, so apparantly it is essential.
>
>Any ideas what is the problem and how to deal with this?
>
>Thanks,
>
>Auke

Auke,
Ne00: ... Ne03: etc are enumeration values read from registry. However you don't need them. ActivePrinter = getprinter() works. I really don't have an idea why not working there.
Enumprinter, getprinter etc API also doesn't return Ne0x thing. AFAIK it's only read from registry. Maybe you could reveal some registry error checking printers (duplicate enumeration ?).
BTW I never tried :

lcActivePrinter = getprinter()

.AcivePrinter = lcAtivePrinter
but :
.ActiveWorkbook.ActiveSheet.PrintOut(,,,, lcActivePrinter)

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform