#include "fivewin.ch"
FUNCTION MAIN( )
LOCAL oExcel
LOCAL oFoglio
LOCAL oAS
oExcel := CreateObject("Excel.Application")
oFoglio := oExcel:WorkBooks:Add
oAs := oExcel:Activesheet()
oAs:Cells( 1 , 1 ):Value := "123456"
oFoglio:SaveAs( "c:\fwh\samples\codmaker.xls" , [b]43[/b] , "123456" )
oExcel:Quit()
RETURN NIL
#include "fivewin.ch"
FUNCTION MAIN( cFileIn , cFileOut )
LOCAL oExcel
LOCAL oFoglio
oExcel := CreateObject("Excel.Application")
oFoglio := oExcel:WorkBooks:Open( cFileIn, OleDefaultArg() , OleDefaultArg() , OleDefaultArg() )
oFoglio:SaveAs( cFileOut , OleDefaultArg() , "123456" )
oExcel:Quit()
RETURN NIL
Gale FORd wrote:You can ferase() the file as long as you did not open it already in Excel.
oExcel := CreateObject("Excel.Application")
oFoglio := oExcel:WorkBooks:Open( FileXL, OleDefaultArg() , OleDefaultArg() , OleDefaultArg() )
FERASE(FileXL) // PROBLEM!!!
oFoglio:SaveAs( FileXL , OleDefaultArg() , "i1978" )
oExcel:Quit()
codemaker wrote:Gale FORd wrote:So I am back to square one. How can I avoid the program asking me if I want to overwrite the existing XLS.... ?
oExcel:DisplayAlerts := .F.
oExcel:ActiveWorkbook:password=YourPassword
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 60 guests