Ver Mensaje Individual
  #1  
Antiguo 27-01-2011
pvelarde pvelarde is offline
Registrado
 
Registrado: sep 2008
Posts: 2
Reputación: 0
pvelarde Va por buen camino
Error automatización Excel 2010

Hola,

Alguien sabe porque el siguiente código no funciona en Excel 2010 (Home and Small Business Office Edition) y si en la versión profesional y en versiones anterior de Microsoft Office ¿?

Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject); var   rango : OleVariant;   ExcelObject : TExcelApplication;   ExcelWorksheet : TExcelWorksheet;   LCID : integer;   begin     try     ExcelObject := TExcelApplication.Create (self);     LCID := LOCALE_USER_DEFAULT;       ExcelObject.Workbooks.Add(EmptyParam, LCID);       ExcelWorksheet := TExcelWorksheet.Create(ExcelObject);     ExcelWorksheet.ConnectTo(ExcelObject.Worksheets.Item [1] as _Worksheet);       rango := ExcelWorksheet.Range['B2','B2'];     rango.Font.size := 16;     rango.Font.Bold := True;     rango.Value2 := 'test';       ExcelObject.Visible[lcid] := true;     except     on e: exception do       showmessage(e.message);          end;   end;

una excepción es generada cuando se añade el libro:

Código Delphi [-]
"ExcelObject.Workbooks.Add(EmptyParam, LCID);"


saludos y muchas gracias,
Responder Con Cita