Lotus Notes / Domino Sonstiges > OLE/COM-Programmierung

[gelöst] Excel-Export mit Ränder versehen

(1/1)

LordKiri:
Hallo,

ich habe einen tollen Agenten, der mir einen Excelexport macht, das ganze funktioniert auch tadelos.
Mein Problem ich soll nach dem Export alle Ränder anzeigen lassen aber ich kriegs nicht hin...

Habe es mit diversen kombinationen probiert:

--- Code: ---xlApp.Range(xlsheet.Cells(2,1), xlsheet.Cells(rows,maxcols)).Select
xlApp.Selection.Font.Name = "Arial"
xlApp.Selection.Font.Size = 9

xlApp.Selection.Borders
--- Ende Code ---

Axel:
Versuch's mal so:

   Const xlEdgeBottom = 9
   Const xlEdgeLeft = 7
   Const xlEdgeRight = 10
   Const xlEdgeTop = 8
   Const xlContinuous = 1
   Const xlThin = 2
   Const xlAutomatic = -4105

                ...
                ...

   With  xlApp.Selection.Borders(xlEdgeLeft)
      .LineStyle = xlContinuous
      .Weight = xlThin
      .ColorIndex = xlAutomatic
   End With
   With  xlApp.Selection.Borders(xlEdgeTop)
      .LineStyle = xlContinuous
      .Weight = xlThin
      .ColorIndex = xlAutomatic
   End With
   With  xlApp.Selection.Borders(xlEdgeBottom)
      .LineStyle = xlContinuous
      .Weight = xlThin
      .ColorIndex = xlAutomatic
   End With
   With  xlApp.Selection.Borders(xlEdgeRight)
      .LineStyle = xlContinuous
      .Weight = xlThin
      .ColorIndex = xlAutomatic
   End With

Das Ganze lässt sich sicher noch vereinfachen, aber auf die Schnelle war nicht mehr drin.  ;)

Axel

LordKiri:
Danke... habs jetzt hinbekommen....

Und schon beim nächsten Problem.... das Dokument sollte anschließend ausgedruckt werden nur möchte ich nicht einfach per xlsheet.PrintOut drucken, sondern den Druckdialog aufrufen...

Gibt es hierfür eine einfache Lösung?

Axel:
So geht's

Const xlDialogPrint = 8
...
xlApp.Dialogs(xlDialogPrint).Show


Axel

LordKiri:
auch das hat geklappt, danke...

Navigation

[0] Themen-Index

Zur normalen Ansicht wechseln