Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Export to Excel With Coloured Rows
Message
From
11/02/2013 04:43:27
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
11/02/2013 04:18:35
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01565703
Message ID:
01565707
Views:
54
>I am Having table which contains many Rows and columns.
>
>I want to Export export it to .XLS and I want that If filed remarks of my Table has "N" Value that row should be highlited in RED colour in exported .XLS file.
>
>Kinldy Guide. How to Do This

After export, open the sheet (manually or, if you're up to it, via automation) and apply formatting. If automation, you'd have to loop through the rows, check the value in the remarks cell, and if it contains that value, apply the formatting to the whole row. Now I haven't done lot of excel automation last seven years, so the syntax is probably wrong:
oSheet=oExcel.activeSheet
for each oRow in oSheet.rows
    if oRow.cells(32).value="your value"
       oRow.color=0xff0000   && or whatever goes for red in excel
    endif
endfor
Not sure if this is the proper way to get a reference to the active sheet, maybe you need to get active workbook first, then the sheet from it. I took 32 as an example; your remarks cell may be in any column - you'll know which.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform