FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour SOLVED - Per mille symbol
Posts: 368
Joined: Sun May 31, 2009 06:25 PM
SOLVED - Per mille symbol
Posted: Wed Jul 05, 2017 07:38 PM
To all

I am trying to use the per mille symbol in an Excel cell but it does not work. My code is:

Code (fw): Select all Collapse
oSheet:Cells( nK, 2 ):value := "‰"


But the cell appears blank. What is the correct way to achieve this?

Thanks
Regards,



André Dutheil

FWH 13.04 + HB 3.2 + MSVS 10
Posts: 663
Joined: Mon Dec 05, 2005 11:22 PM
Re: Per mille symbol
Posted: Wed Jul 05, 2017 10:46 PM

What font is Excel using for that cell? Might try different font

Posts: 368
Joined: Sun May 31, 2009 06:25 PM
Re: Per mille symbol
Posted: Wed Jul 05, 2017 11:11 PM

I'm using Calibri, but I don't think it's a font problem because I can paste the symbol once the table is ready.

Regards,



André Dutheil

FWH 13.04 + HB 3.2 + MSVS 10
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Per mille symbol
Posted: Thu Jul 06, 2017 06:59 AM
I added the symbol without any problem

I used EXCEL2.prg from samples

#include "FiveWin.ch"

function Main()

local oExcel := CreateObject( "excel.application" )
local oBook := oExcel:Workbooks:Add()
local oSheet := oBook:Worksheets( 1 )

oSheet:Range( "A1" ):Value = "Last Name"
oSheet:Range( "B1" ):Value = "First Name"
oSheet:Range( "A1:B1" ):Bold = .T.

oSheet:Range( "A2" ):Value = "Doe"
oSheet:Range( "B2" ):Value = "John"
oSheet:Range( "C2" ):Value = "‰"

//oSheet:Cells( nK, 2 ):value := "‰"

oBook:SaveAs( CurDrive() + ":\" + CurDir() + "\Book1.xls" )
oExcel:Visible = .T.

// oExcel:Quit()

MsgInfo( "ok" )

return nil



regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 368
Joined: Sun May 31, 2009 06:25 PM
Re: Per mille symbol
Posted: Thu Jul 06, 2017 11:32 AM

The problem is connected to codepage. When I comment HB_SETCODEPAGE( "PTISO" ) at the beginning of my program a character shows up in the cell but it's still not the per mille symbol and the rest of the cells loose all their accents.

Regards,



André Dutheil

FWH 13.04 + HB 3.2 + MSVS 10
Posts: 368
Joined: Sun May 31, 2009 06:25 PM
Re: SOLVED - Per mille symbol
Posted: Thu Jul 06, 2017 01:48 PM
Might not be the best way but it works.

Code (fw): Select all Collapse
HB_SETCODEPAGE( "UTF8EX" )
oSheet:Cells( nK, 2 ):value := HB_UTF8ToStr( "Ă¢â‚¬Â°" )
HB_SETCODEPAGE( "PTISO" )
Regards,



André Dutheil

FWH 13.04 + HB 3.2 + MSVS 10

Continue the discussion