![]() |
![]() |
![]() |
![]() |
![]() |
FTP | ![]() |
![]() |
CCD | ![]() |
![]() |
Buscar | ![]() |
![]() |
Trucos | ![]() |
![]() |
Trabajo | ![]() |
![]() |
Foros | ![]() |
|
Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
![]() |
|
Herramientas | Buscar en Tema | Desplegado |
#1
|
|||
|
|||
![]() e
![]() pero cuando quiero crear la siguiente hoja escribo y me marca Error indice invalido por favor agradeceria mucho su ayuda o alguna pista Última edición por dec fecha: 13-10-2005 a las 00:56:00. Razón: ¡¡Encerrad el código fuente entre las etiquetas [DELPHI] ... [/DELPHI]!! |
#2
|
||||
|
||||
Tal vez es porque no estén creadas.
Deberías revisar si WorkSheets tiene algun método Add o similar.
__________________
Germán Estévez => Web/Blog Guía de estilo, Guía alternativa Utiliza TAG's en tus mensajes. Contactar con el Clubdelphi ![]() P.D: Más tiempo dedicado a la pregunta=Mejores respuestas. |
#3
|
||||
|
||||
Yo habia creado esta clase (en Builder) para interactuar con el Excel, mira bien la parte de la creacion del libro y a partir de ahi la instruccion para llamar las hojas:
Código:
class Excel { public: Variant xlApp; Variant xlBooks; Variant xlBook; Variant xlSheets; Variant xlSheet; Variant xlRange; void AbrirExcel(bool Visible) { xlApp = CreateOleObject("Excel.Application"); //LLamamos al Excel xlApp.Exec(PropertySet("Visible") << Visible); xlBooks=xlApp.Exec(PropertyGet("Workbooks")); //LLamamos al conjunto de libros xlBooks.Exec(Procedure("Add")); //Le agregamos 1 xlBook = xlBooks.Exec(PropertyGet("Item")<<1); //LLamamos a ese libro xlSheets = xlBook.Exec(PropertyGet("Worksheets")); //LLamamos al conjunto de hojas del primer libro xlSheet = xlSheets.Exec(PropertyGet("Item") << 1); //LLamamos a la primera hoja } void Escribir(int fila, int colm, AnsiString Value) { AnsiString Celda=AnsiString((char)(64+colm))+AnsiString(fila); xlRange= xlSheet.Exec(PropertyGet("Range") << Celda); xlRange.Exec(PropertySet("Value") << Value); } void Escribir(int fila, int colm, AnsiString Value,AnsiString Formato) { AnsiString Celda=AnsiString((char)(64+colm))+AnsiString(fila); xlRange= xlSheet.Exec(PropertyGet("Range") << Celda); xlRange.Exec(PropertySet("Value") << Value.ToDouble()); xlRange.Exec(PropertySet("NumberFormat") << Formato); } void Guardar(AnsiString FileName) { xlBook.Exec(Procedure("SaveAs") << FileName); //FileName debe tener extensiòn .xls } void Cerrar(bool Close=false) { if( Close) xlApp.Exec(Procedure("Quit")); xlApp.Clear(); } };
__________________
Los Estados Unidos parecen destinados por la Providencia para plagar la América de miserias a nombre de la libertad." Simón Bolívar (Carta al Coronel Inglés Patricio Cambell 05/08/1829). |
#4
|
|||
|
|||
![]() agradezco tu ayuda, en error que me envía era por otra linea de codigo y no por lo que yo creía. y bueno ya puedo crear las 6 hojas.
Atte. Martha Ayala |
![]() |
|
|
![]() |
|