EXCEL and cell borders - how to set them?

Moderator: Rathinagiri

Post Reply
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

EXCEL and cell borders - how to set them?

Post by mol »

Hi!
I need to export some data to excel workbook.
Everythink works OK, but, I don't know how to set borders of cells.

Has anybody working sample how to set borders?

Best regards, Marek
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: EXCEL and cell borders - how to set them?

Post by Rathinagiri »

Code: Select all

xlEdgeLeft := 7
xlContinuous := 1
oExcel := TOleAuto():new( "Excel.Application" )
if Ole2TxtError() != "S_OK"
   MsgStop("Excel Not available.", "Error")
   return nil
endif
oExcel:WorkBooks:add()
oH := oExcel:Get( "ActiveSheet" )
oH:cells(1,1):Borders(xlEdgeLeft):LineStyle := xlContinuous
For other constants please see here:

http://technet.microsoft.com/en-us/libr ... 92886.aspx
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: EXCEL and cell borders - how to set them?

Post by mol »

I have a problem while exporting polish national characters to Excel. It takes from hmg 3.0.37 - I think, change of harbour 2 to harbour 3 causes problems.
Problem with national characters appear in reading data from MS SQL Database via ODBC, too.

Is known any solution for this problem?
Maybe I've missed any declaration which must be added to main function?


Best regards, Marek
Post Reply