Nach langer Zeit auch mal wieder in Beitrag von mir.
Wir setzen seit ein paar Wochen MS-Office 2010 ein.
Schon seit Jahren bediene ich Exceltabellen über ActiveX mit xbase.
Hier möchte ich ein ausgeblendetes Blattregister für die Dateneintragung einblenden. Das hat bisher auch immer funktioniert.
Code: Alles auswählen
// Create the "Excel.Application" object
oExcel := CreateObject("Excel.Application")
IF Empty( oExcel )
tdMsg("Excel ist nicht installiert!" )
RETURN NIL
ENDIF
// Avoid message boxes such as "File already exists". Also,
// ensure the Excel application is visible.
oExcel:DisplayAlerts := .F.
* oExcel:visible := .T.
// Add a workbook to the Excel application. Query for
// the active sheet (sheet-1) and set up page/paper
// orientation.
oBook := oExcel:workbooks:Open(ConvToOEMCP(cDataPath+"ProFiErg.xls"))
********************* DIE FOLGENDE ZEILE VERURSACHT DEN FEHLER **********************
oBook:Worksheets(cBlatt):Visible:=.T.
******************************************************************************************************
oSheet := oBook:Worksheets(cBlatt)
oSheet:Activate
Welchen Typ muss ich denn da wohl nutzen? Statt cBlatt (hier: "KAPGroessenklassen") hatte ich vorher nBlatt (hier: 4). Ich dachte halt, dass ich die Blattregister nicht mehr über die Stelle, sondern über die Bezeichnung ansprechen muss, aber das war's nicht.------------------------------------------------------------------------------
FEHLERPROTOKOLL von "D:\Daten\Temp\20120207_Test_ProFi\Analysetool\KAP3.EXE" Datum: 07.02.2012 14:32:20
Xbase++ Version : Xbase++ (R) Version 1.90.355
Betriebssystem : Windows Vista 06.01 Build 07601 Service Pack 1
------------------------------------------------------------------------------
oError:args :
-> VALTYPE: C VALUE: Visible
-> VALTYPE: L VALUE: .T.
oError:canDefault : J
oError:canRetry : N
oError:canSubstitute: J
oError:cargo : NIL
oError:description : Typkonflikt.
Parameter hat falschen Typ
oError:filename : NIL
oError:genCode : NIL
oError:operation : Visible
oError:osCode : -2147352571
oError:severity : 2
oError:subCode : 6500
oError:subSystem : Automation
oError:thread : 3
oError:tries : NIL
------------------------------------------------------------------------------
CALLSTACK:
------------------------------------------------------------------------------
Called from PROFIEXPORT(888)
Called from PROFI(724)
Kann/Muss/Sollte ich statt .T. irgendwie 0/1 oder -1/0 eintragen? Aber wie? Ich habe schon verschiedene Konstellationen ausprobiert.
Fehlt mir vielleicht eine (aktuelle) "activex.ch"?
Jemand eine Idee?
Danke und Gruß
Christof