Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. articles. downloads. faq. members. files. rss.
 From: Vincent Byrne
  Where is Vincent Byrne?
 Dorsten
 Germany
 Vincent Byrne
 To: rommel david
  Where is rommel david?
 Manila
 Philippines
 rommel david
Subject: RE: fill color to excel programmatically
Thread ID: 109071 Message ID: 109102 # Views: 3 # Ratings: 1
Version: Visual FoxPro 7 Category: Visual Basic
Date: Friday, October 6, 2006 12:30:53 PM         
   



Hi David

Try the following code, it will create a excel object and fill the background color of ten cells


LOCAL oExcel as "Excel.application" 

* create an instance of excel and make it visible
oExcel = CREATEOBJECT("Excel.application")
oExcel.visible = .t.

* add a new workbook  and select the first sheet
oExcel.Workbooks.Add 
oExcel.Sheets(1).select

* set the interior color with the index fromm i 
FOR i = 1 TO 10
	oExcel.Cells(i, 3).Interior.ColorIndex  = i
next

* after filling all cells quit the application
* here we get a message because excel has not saved the file
oExcel.quit 



Best Regards

Vince

ENTIRE THREAD

fill color to excel programmatically Posted by rommel david @ 10/6/2006 8:22:39 AM
RE: fill color to excel programmatically Posted by tushar @ 10/6/2006 11:45:13 AM
RE: fill color to excel programmatically Posted by rommel david @ 10/9/2006 5:40:28 AM
RE: fill color to excel programmatically Posted by Vincent Byrne @ 10/6/2006 12:30:53 PM
RE: fill color to excel programmatically Posted by rommel david @ 10/9/2006 5:44:14 AM