FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour GetExcelRange and decimals
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
GetExcelRange and decimals
Posted: Tue Nov 21, 2017 09:54 AM

Hello Rao ,

I use GetExcelRange to import from Excel .
When in Excel I have a number with many decimals like 0,000079 ( in Italy we use , as decimals )
GetExcelRange returns 0,0001000

Thanks in anticipations

Maurizio

www.nipeservice.com

Posts: 1515
Joined: Thu Oct 30, 2008 02:37 PM
Re: GetExcelRange and decimals
Posted: Tue Nov 21, 2017 03:37 PM

did you try SET DECIMALS TO 6 from harbour or similar from excel ?

Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Re: GetExcelRange and decimals
Posted: Tue Nov 21, 2017 04:28 PM

Thanks ,
but I've already tried set decimal to in harbour.

Maurizio

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: GetExcelRange and decimals
Posted: Tue Nov 21, 2017 09:38 PM

Can we see a little sample showing the problem, please?

EMG

Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Re: GetExcelRange and decimals
Posted: Wed Nov 22, 2017 11:32 AM
Ciao Enrico

Code (fw): Select all Collapse
#include "fivewin.ch"
Function Main()
Local oRange    

SET DECIMAL TO 7

oRange   := GetExcelRange( "c:\fwmy\articoli.xlsx" )
xbrowse(oRange)
oRange:WorkSheet:Parent:Close()

Return nil

https://drive.google.com/open?id=19o7pyrW88tAf315sSEeu2c0hS49ZY0wv


Regards Maurizio
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: GetExcelRange and decimals
Posted: Wed Nov 22, 2017 12:37 PM

We need the Excel file too.

EMG

Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Re: GetExcelRange and decimals
Posted: Wed Nov 22, 2017 01:21 PM
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: GetExcelRange and decimals
Posted: Wed Nov 22, 2017 01:47 PM

The problem is in the cell format. Please try with Numeric format.

EMG

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: GetExcelRange and decimals
Posted: Wed Nov 22, 2017 04:37 PM
Code (fw): Select all Collapse
   XBROWSER oRange SETUP ( oBrw:prezzonetto:cEditPicture := "9.999999" )
Regards



G. N. Rao.

Hyderabad, India
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Re: GetExcelRange and decimals
Posted: Wed Nov 22, 2017 04:47 PM

Thanks Enrico and RAO
works with both
Maurizio

Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: GetExcelRange and decimals
Posted: Wed Nov 22, 2017 04:53 PM
here I have this :

on sheet excel



When run the test



there is something of wrong ... why change the value ?

look price articles... the price is changed

why it rounds to the integer ?

15> 00
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: GetExcelRange and decimals
Posted: Wed Nov 22, 2017 05:50 PM
Sylvio

Did you try with this code?
Code (fw): Select all Collapse
XBROWSER oRange SETUP ( oBrw:prezzonetto:cEditPicture := "9.999999" )
Regards



G. N. Rao.

Hyderabad, India
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: GetExcelRange and decimals
Posted: Wed Nov 22, 2017 06:07 PM

yes of course

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com

Continue the discussion