FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Tsbrowse Exceloel Char Problem
Posts: 59
Joined: Thu May 17, 2007 08:27 AM
Tsbrowse Exceloel Char Problem
Posted: Fri Dec 12, 2008 09:39 AM

hi Everyone:

In TsBrowse ,Field value "00431224566" , when oBRW:ExcelOle() to Excel .

Excel Value show 4311224566 , value is Nunber type .

Someone help me How to make it to a Char type ?

Thank you.

--
Best Regards


kokoo KAO

-------------

best regards

kokoo Kao
Posts: 312
Joined: Sat Oct 08, 2005 09:12 AM
Re: Tsbrowse Exceloel Char Problem
Posted: Fri Dec 12, 2008 11:20 AM
kokookao2007 wrote:hi Everyone:

In TsBrowse ,Field value "00431224566" , when oBRW:ExcelOle() to Excel .

Excel Value show 4311224566 , value is Nunber type .

Someone help me How to make it to a Char type ?

Thank you.

--
Best Regards
--------------------------------------------------------------
kokoo KAO


Kokoo,

try to put a chr( 39 ) before your string.

oSheet:Cells( nRow, nCol ):Value := "'00431224566"


Regards,
Detlef
Posts: 59
Joined: Thu May 17, 2007 08:27 AM
Tsbrowse Exceloel Char Problem
Posted: Fri Dec 12, 2008 01:47 PM
HI Detlef :

Thank you .

oSheet:Cells( nRow, nCol ):Value := "'00431224566"


Any possiable not to add "'" into the Char to makt it ?

--
Best Regards
--------------------------------------------------------------
kokoo KAO
-------------

best regards

kokoo Kao
Posts: 312
Joined: Sat Oct 08, 2005 09:12 AM
Tsbrowse Exceloel Char Problem
Posted: Fri Dec 12, 2008 02:06 PM
Kokoo,

you may also try
#define xlLeft         -4131 // (0xhffffefdd)
#define xlRight        -4152 // (0xhffffefc8)
#define xlCenter       -4108 // (0xhffffeff4)


oSheet:Columns( n ):Set( "HorizontalAlignment", xlRight )
oSheet:Columns( n ):Set( "ColumnWidth",  12 )
oSheet:Columns( n ):Set( "NumberFormat", "@" ) // Text format


With this code i set a complete column to text format.
The above code is working.

May be it works with cells too.
oSheet:Cells( nRow, nCol ):Set( "NumberFormat", "@" )
oSheet:Cells( nRow, nCol ):Value := "00431224566"

This code i didn't try.

regards,
Detlef
Posts: 59
Joined: Thu May 17, 2007 08:27 AM
Tsbrowse Exceloel Char Problem
Posted: Fri Dec 12, 2008 03:00 PM
HI Detlef:


oSheet:Cells( nRow, nCol ):Set( "NumberFormat", "@" )


It is work as what I need.

Thank you.

--
Best Regards
--------------------------------------------------------------
kokoo KAO
-------------

best regards

kokoo Kao

Continue the discussion