Autor Thema: [gelöst] Excel-Export mit Ränder versehen  (Gelesen 5098 mal)

Offline LordKiri

  • Senior Mitglied
  • ****
  • Beiträge: 252
  • aka Andreas
[gelöst] Excel-Export mit Ränder versehen
« am: 15.12.08 - 14:13:49 »
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
« Letzte Änderung: 15.12.08 - 16:19:49 von LordKiri »

Offline Axel

  • Freund des Hauses!
  • Gold Platin u.s.w. member:)
  • *****
  • Beiträge: 8.658
  • Geschlecht: Männlich
  • It's not a bug, it's Notes
Re: Excel-Export mit Ränder versehen
« Antwort #1 am: 15.12.08 - 15:20:39 »
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
Ohne Computer wären wir noch lange nicht hinterm Mond!

Offline LordKiri

  • Senior Mitglied
  • ****
  • Beiträge: 252
  • aka Andreas
Re: Excel-Export mit Ränder versehen
« Antwort #2 am: 15.12.08 - 15:52:09 »
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?

Offline Axel

  • Freund des Hauses!
  • Gold Platin u.s.w. member:)
  • *****
  • Beiträge: 8.658
  • Geschlecht: Männlich
  • It's not a bug, it's Notes
Re: Excel-Export mit Ränder versehen
« Antwort #3 am: 15.12.08 - 16:02:29 »
So geht's

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


Axel
Ohne Computer wären wir noch lange nicht hinterm Mond!

Offline LordKiri

  • Senior Mitglied
  • ****
  • Beiträge: 252
  • aka Andreas
Re: Excel-Export mit Ränder versehen
« Antwort #4 am: 15.12.08 - 16:19:33 »
auch das hat geklappt, danke...

 

Impressum Atnotes.de  -  Powered by Syslords Solutions  -  Datenschutz