Domino 9 und frühere Versionen > ND6: Entwicklung

Fehlermeldung beim Excel-Export

(1/2) > >>

Alexis:
Hallo Forum,

beim Excel-Export erhalte ich die folgende Fehlermeldung:


--- Zitat ---Microsoft Office Excel: Die AutoFilter-Eigenschaft des Range-Objektes kann nicht festgelegt werden.
--- Ende Zitat ---

Trotzdem wird brav die Filterfunktion im Excel-Sheet gebracht.

Der Code-Abschnitt endet mit:


--- Code: ---xlApp.Application.Selection.Autofilter = True
--- Ende Code ---

Kann mir jemand sagen, wie die Range-Angabe heissen muss?


Alexis

ZaLudtske:
Bitte kompletten Code-Abschnitt posten.

Rainer

Alexis:
Hier der betreffende Abschnitt:


--- Code: ---'Erste Reihe Spaltenbeschriftung
xlApp.application.Rows("1:1").Select
With xlApp.application.Selection
.Font.bold = True
.Font.ColorIndex = 0
.Font.Name = "Arial"
.Font.Size = 10
.Interior.ColorIndex = 0
End With
' ---------------------------------------------------------------------------------
'Fenster fixieren
xlApp.application.Rows("2:2").Select
xlApp.application.ActiveWindow.FreezePanes = True

'Aussehen der Spalten und Kopfzeile
xlApp.cells.select
xlApp.selection.Columns.AutoFit
xlApp.application.rows("1:1").Select
xlApp.ActiveSheet.PageSetup.centerheader = "&""Arial Black,Fett"" Database: Plant System Inventory"  + "  Export created on: " +  Format(Now,"dd/MM/yyyy HH:MM")
xlApp.ActiveSheet.PageSetup.PrintTitleRows = "$1:$1"
xlApp.ActiveSheet.PageSetup.PrintGridlines = True
xlApp.ActiveSheet.PageSetup.Orientation = 2

xlApp.Application.DisplayAlerts = False
xlApp.Application.EnableEvents = False
xlApp.Cells.Replace "[" , ""
xlApp.Application.EnableEvents = True
xlApp.Application.DisplayAlerts = True

xlApp.Application.DisplayAlerts = False
xlApp.Application.EnableEvents = False
xlApp.Cells.Replace "]" , ""
xlApp.Application.EnableEvents = True
xlApp.Application.DisplayAlerts = True

xlApp.Application.DisplayAlerts = False
xlApp.Application.EnableEvents = False
xlApp.Cells.Replace "(" , ""
xlApp.Application.EnableEvents = True
xlApp.Application.DisplayAlerts = True

xlApp.Application.DisplayAlerts = False
xlApp.Application.EnableEvents = False
xlApp.Cells.Replace ")" , ""
xlApp.Application.EnableEvents = True
xlApp.Application.DisplayAlerts = True

xlApp.Application.DisplayAlerts = False
xlApp.Application.EnableEvents = False
xlApp.Cells.Replace "<" , ""
xlApp.Application.EnableEvents = True
xlApp.Application.DisplayAlerts = True

xlApp.Application.DisplayAlerts = False
xlApp.Application.EnableEvents = False
xlApp.Cells.Replace ">" , ""
xlApp.Application.EnableEvents = True
xlApp.Application.DisplayAlerts = True

xlApp.Application.DisplayAlerts = False
xlApp.Application.EnableEvents = False
xlApp.Cells.Replace "'" , ""
xlApp.Application.EnableEvents = True
xlApp.Application.DisplayAlerts = True
xlApp.Application.ScreenUpdating = True

xlApp.Application.Selection.Autofilter = True
--- Ende Code ---


Alexis

Axel:
Versuch's mal so:

   xlApp.Application.Selection.Autofilter

Die AutoFilter-Eigenschaft ist nämlich schreibgeschützt.


Was mir noch aufgefallen ist, sind die vielen EnableEvents- und DisplayAlerts-Anweisungen. Meines Erachtens kannst du dir die sparen.


--- Code: ---...
xlApp.Application.DisplayAlerts = False
xlApp.Application.EnableEvents = False
xlApp.Cells.Replace "[" , ""
xlApp.Cells.Replace "]" , ""
xlApp.Cells.Replace "(" , ""
xlApp.Cells.Replace ")" , ""
xlApp.Cells.Replace "<" , ""
xlApp.Cells.Replace ">" , ""
xlApp.Cells.Replace "'" , ""
xlApp.Application.EnableEvents = True
xlApp.Application.DisplayAlerts = True
xlApp.Application.ScreenUpdating = True
...

--- Ende Code ---

Axel

just.do.it:

--- Zitat von: Alexis am 12.12.06 - 16:56:42 ---beim Excel-Export erhalte ich die folgende Fehlermeldung:


--- Zitat ---Microsoft Office Excel: Die AutoFilter-Eigenschaft des Range-Objektes kann nicht festgelegt werden.
--- Ende Zitat ---

Trotzdem wird brav die Filterfunktion im Excel-Sheet gebracht.

Der Code-Abschnitt endet mit:


--- Code: ---xlApp.Application.Selection.Autofilter = True
--- Ende Code ---

Kann mir jemand sagen, wie die Range-Angabe heissen muss?

--- Ende Zitat ---

Autofilter ist eine Methode und keine Eigenschaft. Es muss also heißen

xlApp.Application.Selection.Autofilter
Gruß
Dirk

Navigation

[0] Themen-Index

[#] Nächste Seite

Zur normalen Ansicht wechseln