Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Running Excel from VFP App
Message
From
06/05/2006 09:45:28
 
 
To
05/05/2006 21:29:28
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01119766
Message ID:
01119861
Views:
17
Thanks a lot for your help, but I allready done it....

This is the final code, I wonder if you say any comments about it....

if !IsClassRegistered("Excel.Application")
messagebox("Excel is not installed")
else
a="C:\estaib\archivos\abril2006.xls"
b="C:\estaib\archivos\rankingabril2006.xls"
oExcel = createobject("Excel.application")
with oExcel
.Workbooks.Open(a)
.visible = .t.
.ActiveWorkBook.ActiveSheet.Range("E:E").Numberformat = "#,##0"
.ActiveWorkBook.ActiveSheet.Range("F:F").Numberformat = "#,##0.00"
.ActiveWorkBook.ActiveSheet.Range("A1:F1").Font.Bold=.t.
.ActiveWorkBook.ActiveSheet.Range("A1:F65536").Font.Size=10
.ActiveWorkBook.ActiveSheet.Range("A1:F65536").Font.Name='Tahoma'
.ActiveWorkBook.ActiveSheet.Range("A1:F65536").EntireColumn.AutoFit
.ActiveWorkBook.ActiveSheet.Range("A1:F1").HorizontalAlignment = -4108
.ActiveWorkBook.ActiveSheet.Range("A1:F1").VerticalAlignment = -4108
.ActiveWorkbook.Save
.Workbooks.Open(b)
.visible = .t.
.ActiveWorkBook.ActiveSheet.Range("C:C").Numberformat = "#,##0.00"
.ActiveWorkBook.ActiveSheet.Range("D:D").Numberformat = "#,##0"
.ActiveWorkBook.ActiveSheet.Range("A1:F1").Font.Bold=.t.
.ActiveWorkBook.ActiveSheet.Range("A1:F65536").Font.Size=10
.ActiveWorkBook.ActiveSheet.Range("A1:F65536").Font.Name='Tahoma'
.ActiveWorkBook.ActiveSheet.Range("A1:F65536").EntireColumn.AutoFit
.ActiveWorkBook.ActiveSheet.Range("A1:F1").HorizontalAlignment = -4108
.ActiveWorkBook.ActiveSheet.Range("A1:F1").VerticalAlignment = -4108
.ActiveWorkbook.Save
endwith
endif
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform