Some Excel OLE commands / functions do not work
Original Reporter info from Mantis: PeterK
-
Reporter name:
Original Reporter info from Mantis: PeterK
- Reporter name:
Description:
Accessing Excel with OLE in general works.
But especially the commands with brackets do not work:
sOle:= Excel.ActiveSheet.Name; //works
Sheet:= Excel.ActiveSheet; //works
Sheet.Name:= 'renamed_Sheet 2'; //works
//Excel.ActiveSheet.Name:= 'renamed_Sheet 1'; //works
//Sheet.Cells.Value:= OleVariant( 'a'); //works - but fills whole Sheet!
//Sheet:= Excel.Sheets(1); //does not work
//Sheet:= Excel.Sheets[1]; //does not work
//Excel.WorkBooks(1).WorkSheets(1).Name:= 'aasdasds'; //does not work
//Sheet:= Excel.WorkSheets(1); //does not work
//Sheet.Cells[2,2].Value:= sOle; //does not work: "Invalid Argument: Dispatch"
//Excel.ActiveSheet.Cells[2,2].Value:= sOle; //does not work: "Invalid Argument: Dispatch"
//Sheet.Cells[2,2].Select; //does not work: "Invalid Argument: Dispatch"
//Excel.Sheets( 'renamed_Sheet 2').Name:= 'renamed_Sheet 3';
sOle:= Excel.ActiveSheet.Name; //works
//Excel.Sheets( sOle).Select; //does not work: "Member not found"
//Excel.Sheets[ sOle].Select; //does not work: "Invalid Type Cast"
Additional information:
tested with 0.9.30 Lazarus (release)
Mantis conversion info:
- Mantis ID: 20778