我用以下代碼 在ExceL2010 下生成是空白。
var
OleCount:integer;
sheet:variant;
begin
sheet := FMyWork.Sheets[1];
sheet.OLEObjects.add(ClassType := 'BARCODE.BarCodeCtrl.1', DisplayAsIcon := False);
OleCount := sheet.oleobjects.count;
sheet.OleObjects(OleCount).object.left := 10;
sheet.OleObjects(OleCount).object.top := 10;
sheet.OleObjects(OleCount).object.height :=100;
sheet.OleObjects(OleCount).object.width :=100;
sheet.OLeObjects(OleCount).Object.Value:='1111111';
sheet.OleObjects(OleCount).object.style := 7;
end

但是在Excel2007或者2003下生成是正常,請問是什么原因了。
uj5u.com熱心網友回復:
office 2007 是個分水嶺代碼不通用
你的用宏再去找excel2010的代碼
誰說軟體都向下兼容的?
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/91753.html
標籤:非技術區
上一篇:面向物件(多型與內部類)
