SOLVED - Per mille symbol

Post Reply
ADutheil
Posts: 352
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

SOLVED - Per mille symbol

Post by ADutheil »

To all

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

Code: Select all

oSheet:Cells( nK, 2 ):value := "‰"
But the cell appears blank. What is the correct way to achieve this?

Thanks
Last edited by ADutheil on Thu Jul 06, 2017 1:46 pm, edited 1 time in total.
Gale FORd
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston
Contact:

Re: Per mille symbol

Post by Gale FORd »

What font is Excel using for that cell? Might try different font
ADutheil
Posts: 352
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: Per mille symbol

Post by ADutheil »

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 BCC 5.82 MinGW 4.5.2 MSVS 10
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: Per mille symbol

Post by ukoenig »

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" ):Font: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

Image

regards
Uwe :D
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.
ADutheil
Posts: 352
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: Per mille symbol

Post by ADutheil »

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 BCC 5.82 MinGW 4.5.2 MSVS 10
ADutheil
Posts: 352
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: SOLVED - Per mille symbol

Post by ADutheil »

Might not be the best way but it works.

Code: Select all

HB_SETCODEPAGE( "UTF8EX" )
oSheet:Cells( nK, 2 ):value := HB_UTF8ToStr( "‰" )
HB_SETCODEPAGE( "PTISO" )
 
Post Reply