GetExcelRange and decimals

GetExcelRange and decimals

Postby Maurizio » Tue Nov 21, 2017 9: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
User avatar
Maurizio
 
Posts: 796
Joined: Mon Oct 10, 2005 1:29 pm

Re: GetExcelRange and decimals

Postby hmpaquito » Tue Nov 21, 2017 3:37 pm

did you try SET DECIMALS TO 6 from harbour or similar from excel ?
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: GetExcelRange and decimals

Postby Maurizio » Tue Nov 21, 2017 4:28 pm

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


Maurizio
User avatar
Maurizio
 
Posts: 796
Joined: Mon Oct 10, 2005 1:29 pm

Re: GetExcelRange and decimals

Postby Enrico Maria Giordano » Tue Nov 21, 2017 9:38 pm

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

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8307
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: GetExcelRange and decimals

Postby Maurizio » Wed Nov 22, 2017 11:32 am

Ciao Enrico

Code: Select all  Expand view

#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
User avatar
Maurizio
 
Posts: 796
Joined: Mon Oct 10, 2005 1:29 pm

Re: GetExcelRange and decimals

Postby Enrico Maria Giordano » Wed Nov 22, 2017 12:37 pm

We need the Excel file too.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8307
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: GetExcelRange and decimals

Postby Maurizio » Wed Nov 22, 2017 1:21 pm

User avatar
Maurizio
 
Posts: 796
Joined: Mon Oct 10, 2005 1:29 pm

Re: GetExcelRange and decimals

Postby Enrico Maria Giordano » Wed Nov 22, 2017 1:47 pm

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

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8307
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: GetExcelRange and decimals

Postby nageswaragunupudi » Wed Nov 22, 2017 4:37 pm

Code: Select all  Expand view
  XBROWSER oRange SETUP ( oBrw:prezzonetto:cEditPicture := "9.999999" )
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10242
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: GetExcelRange and decimals

Postby Maurizio » Wed Nov 22, 2017 4:47 pm

Thanks Enrico and RAO
works with both
Maurizio
User avatar
Maurizio
 
Posts: 796
Joined: Mon Oct 10, 2005 1:29 pm

Re: GetExcelRange and decimals

Postby Silvio.Falconi » Wed Nov 22, 2017 4:53 pm

here I have this :

on sheet excel

Image

When run the test

Image

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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6755
Joined: Thu Oct 18, 2012 7:17 pm

Re: GetExcelRange and decimals

Postby nageswaragunupudi » Wed Nov 22, 2017 5:50 pm

Sylvio

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

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10242
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: GetExcelRange and decimals

Postby Silvio.Falconi » Wed Nov 22, 2017 6:07 pm

yes of course
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6755
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 12 guests