Estimado Antonio, me iria muy bien el código de EXCEL2.PRG que actualmente da un error si se responde NO al diálogo de "Fichero tal ya existe ¿Desea sobreescribir?". Te adjunto el fichero (FW11.9) y el error.
Disculpa las molestias y gracias, saludos, - Juan -
Application
===========
Path and name: C:\FWH\samples\wocgraph.exe (32 bits)
Size: 1,919,488 bytes
Time from start: 0 hours 0 mins 22 secs
Error occurred at: 12/03/2010, 13:06:28
Error description: Error BASE/3012 Argument error: SAVEAS
Args:
[ 1] = C C:\FWH\samples\Book1.xls
Stack Calls
===========
Called from: => WIN_OLEAUTO:SAVEAS(0)
Called from: wocgraph.prg => AEXCEL(1219)
Called from: wocgraph.prg => (b)CREABARRA(415)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK(453)
#include "FiveWin.ch"
function Main()
local oExcel := CreateObject( "excel.application" )
local oBook := oExcel:Workbooks:Add()
local oSheet := oBook:Worksheets( 1 )
oSheet:Range( "A1" ):Value = "Last Name"
oSheet:Range( "B1" ):Value = "First Name"
oSheet:Range( "A1:B1" ):Font:Bold = .T.
oSheet:Range( "A2" ):Value = "Doe"
oSheet:Range( "B2" ):Value = "John"
oBook:SaveAs( CurDrive() + ":\" + CurDir() + "\Book1.xls" )
oExcel:Visible = .T.
// oExcel:Quit()
MsgInfo( "ok" )
return nil