Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy without save window
Message
 
 
To
25/11/2011 11:01:09
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01529800
Message ID:
01529805
Views:
59
>hi all
>i need to copy excel book to the path directly without save wondow and no open excel sheet after save
>
>gcDelimName = ALIAS( ) + '.xls'
>gcDelimFile = PUTFILE('excel_file:', gcDelimName, 'xls')
>IF EMPTY(gcDelimFile)  
>CANCEL
>ENDIF
>gcDelimfile = forcepath(m.gcDelimfile,'c:\dept\zarqa\')
> COPY TO (gcDelimFile) XLS 
> 
>
>Local loExcel 
>xlDown =   -4121
>xlLastCell = 11
>
>loExcel = CREATEOBJECT('Excel.Application')
>loExcel.DisplayAlerts = .F.
>LoWb = loExcel.WorkBooks.OPEN(gcDelimFile)
>loWs = loExcel.WorkSheets(1)
>loWs.Rows("1:"+Transform(3)).insert(xlDown)
>lows.Range(lows.Cells(1,1),lows.Cells(1,lows.Application.ActiveCell.SpecialCells(xlLastCell).Column) ).MergeCells = .T.
>loWS.cells(1,3).Font.bold  = .t.
>
>loWS.cells(1,3).Font.Size= 14
>
>
>loWS.cells(1,1) = " O??) "+TRANSFORM(YEAR(DATE()))+'/'+TRANSFORM(MONTH(DATE())-1)
>loWS.cells(1,1).Font.bold  = .t.
>loWS.cells(1,1).Font.Size= 14
>
>

Here:

loWB.SaveAs('somefile.xls')


>*loExcel.VISIBLE	= .T.
>*loExcel			= NULL
>
>thanks
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform