Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel Automatization
Message
De
14/02/2004 19:55:28
 
 
À
14/02/2004 19:05:34
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00877437
Message ID:
00877441
Vues:
13
>>Amigos, tengo el siguientes problema.
>He creado una funcion, que genera un libro de excel desde un cursor.
>El problema es que quiero grabar ese libro con un nombre especifico y una ruta que se la pueda enviar como parametro a mi funcion.

>pnamesheet = 'consulta'
>.ActiveWorkbook.SaveAs(pnamesheet)
>
>donde pnamesheet es el nombre del libro excel, por ejemplo 'Consulta'
>pero cuando le mando le cambio el valor a la variable incluyendo la ruta
>donde deseo que se grabe me envia un error de Automatizacion
>
>pnamesheet = 'c:\temp\consulta'
>.ActiveWorkbook.SaveAs(pnamesheet)
>
>Error : Código de Error OLE 0x80020006 : Nombre desconocido
>
>Alguien tiene la solucion a este problema..



Ernesto

Prueba este ejemplo:
pnamesheet="c:\temp\junk.xls"
oXL = CREATEOBJECT("Excel.Application")
oXL.Visible = .t.
oXL.workbooks.Add()
oXL.RANGE("A1").Value = "Test"
oXL.DisplayAlerts=.F.
oXL.ActiveWorkbook.SaveAs(pnamesheet)
oXL.Quit()
Nota: Debes poner mensajes en castellano en la seccion correspondiente al idioma. Esta seccion es para mensajes en ingles.


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform