Page 1 of 1

Error en Toleauto

Posted: Thu Dec 06, 2007 10:53 am
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

Posted: Thu Dec 06, 2007 5:34 pm
by Antonio Linares
No parece necesario que le envies ese mensaje.

Deja comentada la lĂ­nea oDoc:End()