Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using OLE application
Message
From
04/07/2001 07:49:33
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
04/07/2001 06:53:40
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00526632
Message ID:
00526645
Views:
20
>Hi all,
>
>I have used the OLE application to display a table into Excel application and it work well, but I want to make the display to be nice, like changing the fonts or widen the columns so the user didn't have to change the display when they open it. Could anybody help me ?
>
>TIA
>
>Budianto

Budianto,
IMHO easiest is to use one of predefined formats.
Use customer
Copy to customerxls type xls

#include xlconstants.h
oExcel=createobject('Excel.Application')
With oExcel
  .Workbooks.Open(sys(5)+curdir()+'customerxls.xls')
  With .ActiveWorkBook.ActiveSheet
    .Range("A1").AutoFormat(xlRangeAutoFormatColor2)
*!*	    *Format headers
*!*	    .Cells(1,1).VALUE = "Customer Id"
*!*	    * Format the data
*!*	    .RANGE("1:1").FONT.Bold=.T.
*!*	    .RANGE("L:L").NumberFormat = [_($* #,##0.00_);_($* (#,##0.00);_($* ""-""??_);_(@_)]
*!*	    With .Range('A:A').Font
*!*	      .Bold = .t.
*!*	      .Size = 12
*!*	      .Color = rgb(255,0,0)
*!*	    Endwith
*!*	    With .Range('B:B').Font
*!*	      .Bold = .t.
*!*	      .Italic=.t.
*!*	      .Size = 12
*!*	      .Color = rgb(0,0,255)
*!*	    Endwith
*!*	    With .Range('E:E').Font
*!*	      .Bold = .t.
*!*	      .Italic=.t.
*!*	      .Size = 12
*!*	    Endwith
*!*	    .Columns.Autofit
    .Range("A1").select
  Endwith
  .visible = .t.
Endwith
Comment autoformat line and uncomment the commented to see custom formatting.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform