(Moderator)
Registriert seit: 9. Dez 2005
Ort: Heilbronn
39.858 Beiträge
Delphi 11 Alexandria
|
AW: Excel - DropDown-Menü in einer Zelle erzeugen
17. Nov 2014, 15:18
Wie gesagt, verwendet COM/ OLE die selbe Schnittstelle
Delphi-Quellcode:
Uses ...,ComObj, ActiveX, ...
...
var
Excel, WorkBook, WorkSheet, Range: OleVariant;
begin
try
Excel := GetActiveOleObject(' Excel.Application');
except
Excel := CreateOleObject(' Excel.Application');
end;
WorkBook := Excel.ActiveWorkBook;
WorkSheet := WorkBook.ActiveSheet;
Range := WorkSheet.Range[' A1:A4'];
Range.Validation.Delete;
Range.Validation.Add(3, 1, 1, ' Join(MyList, ",")', null);
...
end;
Markus Kinzler
|
|
Zitat
|