Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel Automatization
Message
From
14/02/2004 19:55:28
 
 
To
14/02/2004 19:05:34
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00877437
Message ID:
00877441
Views:
12
>>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
Previous
Reply
Map
View

Click here to load this message in the networking platform