GetExcelRange ERROR

Post Reply
User avatar
Silvio.Falconi
Posts: 7170
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 3 times

GetExcelRange ERROR

Post by Silvio.Falconi »

Making this sample test I can show any datas, where is the error ?

Code: Select all | Expand

#include "FiveWin.ch"

Function test()
local cFileXls:="orario.xlsx"
Local oRange,lOpened:=.f.

oRange := GetExcelRange(cFileXls , , @lOpened)

xbrowser oRange

return nil


I check the file with Google Excel and I see there datas as you can see here

Image
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
User avatar
nageswaragunupudi
Posts: 10729
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 10 times
Contact:

Re: GetExcelRange ERROR

Post by nageswaragunupudi »

GetExcelRange() can not open xls file, if it is already opened by any application other than Microsoft Excel.
Close Google Sheets and try.
Also give full path.
Regards

G. N. Rao.
Hyderabad, India
User avatar
Silvio.Falconi
Posts: 7170
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 3 times

Re: GetExcelRange ERROR

Post by Silvio.Falconi »

nageswaragunupudi wrote:GetExcelRange() can not open xls file, if it is already opened by any application other than Microsoft Excel.
Close Google Sheets and try.
Also give full path.



please I not open the xls file with another app
please do you see my test sample ?
the file orario.xlsx is on the root of exe
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
User avatar
Marc Venken
Posts: 1485
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: GetExcelRange ERROR

Post by Marc Venken »

Your sample is working here. Just a local file from myself in de exe folder. rest is the same
Marc Venken
Using: FWH 23.08 with Harbour
User avatar
Marc Venken
Posts: 1485
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: GetExcelRange ERROR

Post by Marc Venken »

Silvio, keep in mind that the sample is not killing the object, so exel is still in the taskbar. See into it...

Maybe that is a issue at your site..
Marc Venken
Using: FWH 23.08 with Harbour
User avatar
Silvio.Falconi
Posts: 7170
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 3 times

Re: GetExcelRange ERROR

Post by Silvio.Falconi »

Marc Venken wrote:Silvio, keep in mind that the sample is not killing the object, so exel is still in the taskbar. See into it...

Maybe that is a issue at your site..





Image


Can I send you a small test ? my mail is silvio_dot_falconi_at_gmail_dot_com
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
User avatar
nageswaragunupudi
Posts: 10729
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 10 times
Contact:

Re: GetExcelRange ERROR

Post by nageswaragunupudi »

1) Is Microsoft Excel installed on this computer?
Check:
if ExcelObj() == nil
? "Not installed"
else
? "Installed"
endif

2) Also check if file exists with
? File( cFileXls )
Regards

G. N. Rao.
Hyderabad, India
User avatar
Silvio.Falconi
Posts: 7170
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 3 times

Re: GetExcelRange ERROR

Post by Silvio.Falconi »

nageswaragunupudi wrote:1) Is Microsoft Excel installed on this computer?
Check:
if ExcelObj() == nil
? "Not installed"
else
? "Installed"
endif

2) Also check if file exists with
? File( cFileXls )


Sorry Nages,

one question: maybe the problem is that there is no Excel on that computer?

No there is no Excel, discovered the mystery ....

and I was convinced that it could work even without excel

Is there no remote possibility of extracting data from an excel spreadsheet without having Microsoft Excel installed?
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
User avatar
anserkk
Posts: 1333
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India
Has thanked: 2 times

Re: GetExcelRange ERROR

Post by anserkk »

Silvio.Falconi wrote:Is there no remote possibility of extracting data from an excel spreadsheet without having Microsoft Excel installed?

You can use ADO to read the Excel data without having Excel installed on your PC
User avatar
nageswaragunupudi
Posts: 10729
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 10 times
Contact:

Re: GetExcelRange ERROR

Post by nageswaragunupudi »

Yes, Thanks Mr. Anser
FWH has function for reading Excel with ADO

Code: Select all | Expand


oRs := FW_OpenADOExcelSheet( cFile, [cSheet], [cRange], [lHeaders] )
XBROWSER oRs
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
Silvio.Falconi
Posts: 7170
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 3 times

Re: GetExcelRange ERROR

Post by Silvio.Falconi »

nageswaragunupudi wrote:Yes, Thanks Mr. Anser
FWH has function for reading Excel with ADO

Code: Select all | Expand


oRs := FW_OpenADOExcelSheet( cFile, [cSheet], [cRange], [lHeaders] )
XBROWSER oRs
 


thanks Mr Nages,
I tried with

Code: Select all | Expand

oRange := FW_OpenADOExcelSheet(cFileXls)
xbrowser oRange


Give me first this Message "ADO ERROR UKNOWN"
and then "fail to open "C:\work\errori\getexelrange\orario.xls"


I think I must install Microsoft.ACE.OLEDB from https://www.microsoft.com/it-it/download/details.aspx?id=13255

another question
I mustuse it on Tables with windows 10 Pro, I would have preferred not to install a lot of software to make the system more free Office would be a bit heavy
If I would install OpenOffice which is free, what function can I use?
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
Post Reply