Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Servers (https://www.clubdelphi.com/foros/forumdisplay.php?f=9)
-   -   Error automatización Excel 2010 (https://www.clubdelphi.com/foros/showthread.php?t=72093)

pvelarde 27-01-2011 12:18:33

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,

Casimiro Notevi 27-01-2011 13:05:57

Hola, no repitas mensajes, gracias.


La franja horaria es GMT +2. Ahora son las 18:41:42.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi