Error en Toleauto

Post Reply
colthop
Posts: 505
Joined: Sat Apr 22, 2006 9:09 am
Location: Madrid - España

Error en Toleauto

Post by colthop »

Hola amigos:

He pasadfo fuentes de 16 a 32 bits y en uno de ellos creaba un archivo WORD y luego lo abria en word y en 16 bit funcionaba bien.

Ahora me da el siguente error :

Application
===========
Path and name: C:\programa\nyswin\nyswin.exe (32 bits)
Size: 2,343,936 bytes
Time from start: 0 hours 0 mins 16 secs
Error occurred at: 06/12/2007, 11:30:29
Error description: Error Word.Application:ACTIVEDOCUMENT/16389 E_FAIL: END
Args:

Stack Calls
===========
Called from: win32ole.prg => TOLEAUTO:END(0)
Called from: gestimpr.prg => CERTRETE(3766)
Called from: nyswin.prg => (b)PREPARAMENU(299)
Called from: MENU.PRG => TMENU:COMMAND(0)
Called from: WINDOW.PRG => TWINDOW:COMMAND(0)
Called from: MDIFRAME.PRG => TMDIFRAME:COMMAND(0)
Called from: => TMDIFRAME:HANDLEEVENT(0)
Called from: WINDOW.PRG => _FWH(0)
Called from: => WINRUN(0)
Called from: WINDOW.PRG => TMDIFRAME:ACTIVATE(0)
Called from: nyswin.prg => MAIN(68)

la fuente es :

oWord:=TOleAuto():New( "Word.Application" )
cPlantilla := (fic1)
oDoc :=oWord:Documents:Open(cPlantilla) // abre el doc modelo
cViejo := "[EJER1]"
cCampo := (ejer1)
reemplace2 ()

.....

cViejo := "[NOMBRE3]"
cCampo := (nombre3)
reemplace2 ()
oDoc := oWord:Get("ActiveDocument") // object (documento activo)
oDoc:Invoke( "SaveAs", cFich ) // graba fichero
oDoc:Invoke('Close',0) // cierra fichero
oDoc:End(cFich)
oWord:End()
OleUninitialize()
CLOS DATA
oWord:=TOleAuto():New( "Word.Application" )
oWord:Documents:Open(fich)
oWord:Visible := .T.
oWord:Set( "WindowState", 1 )
oWord:End()
OleUninitialize()

y la linea 3766 es :

oDoc:End()

Alguien me podria ayudar.

Gracias
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

No parece necesario que le envies ese mensaje.

Deja comentada la línea oDoc:End()
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply