Ich möchte über mein Programm (Delphi 3)mit Hilfe der OLE- Automatisierung<br>
eine bestimmte Exceldatei holen,<br>
dann einen neuen Standarddrucker festlegen und diese Datei drucken.<br>
Das kann aber alles im Hintergrund passieren.<br>
Mit Word hab ich das schon gemacht und zwar so:<p>
<b>Uses</b> comobj;<br>
<b>var</b> Word: Variant;<p>
<b>begin</b> {OLE-Verbindung zu Word herstellen}<br>
<b>try</b><br>
Word := GetActiveOleObject('Word.Application');<br>
<b>except</b><br>
Word := CreateOleObject('Word.Application');<br>
<b>end</b>;<br>
Word.Documents.Open(Dateiname);<br>
Word.Visible := false;<br>
Word.ActivePrinter := 'Name des Druckers';<br>
Word.PrintOut;<br>
Word.Documents.Close;<br>
Word.Quit;<br>
<b>end</b>;<p>
geht auch wunderbar und ich dachte nun mit Excel ist das nichts anderes,<br>
scheint aber nicht so. Kann mir da jemand helfen?<br>
Bea
eine bestimmte Exceldatei holen,<br>
dann einen neuen Standarddrucker festlegen und diese Datei drucken.<br>
Das kann aber alles im Hintergrund passieren.<br>
Mit Word hab ich das schon gemacht und zwar so:<p>
<b>Uses</b> comobj;<br>
<b>var</b> Word: Variant;<p>
<b>begin</b> {OLE-Verbindung zu Word herstellen}<br>
<b>try</b><br>
Word := GetActiveOleObject('Word.Application');<br>
<b>except</b><br>
Word := CreateOleObject('Word.Application');<br>
<b>end</b>;<br>
Word.Documents.Open(Dateiname);<br>
Word.Visible := false;<br>
Word.ActivePrinter := 'Name des Druckers';<br>
Word.PrintOut;<br>
Word.Documents.Close;<br>
Word.Quit;<br>
<b>end</b>;<p>
geht auch wunderbar und ich dachte nun mit Excel ist das nichts anderes,<br>
scheint aber nicht so. Kann mir da jemand helfen?<br>
Bea
Comment