GetExcelRange ERROR

GetExcelRange ERROR

Postby Silvio.Falconi » Fri Sep 17, 2021 7:42 am

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

Code: Select all  Expand view  RUN
#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 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: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: GetExcelRange ERROR

Postby nageswaragunupudi » Fri Sep 17, 2021 10:58 am

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
nageswaragunupudi
 
Posts: 10656
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: GetExcelRange ERROR

Postby Silvio.Falconi » Fri Sep 17, 2021 2:22 pm

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 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: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: GetExcelRange ERROR

Postby Marc Venken » Fri Sep 17, 2021 2:51 pm

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

Re: GetExcelRange ERROR

Postby Marc Venken » Fri Sep 17, 2021 2:54 pm

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.04 with Harbour
User avatar
Marc Venken
 
Posts: 1446
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: GetExcelRange ERROR

Postby Silvio.Falconi » Fri Sep 17, 2021 7:48 pm

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 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: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: GetExcelRange ERROR

Postby nageswaragunupudi » Fri Sep 17, 2021 9:25 pm

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
nageswaragunupudi
 
Posts: 10656
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: GetExcelRange ERROR

Postby Silvio.Falconi » Sat Sep 18, 2021 6:44 am

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 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: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: GetExcelRange ERROR

Postby anserkk » Mon Sep 20, 2021 4:42 am

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
anserkk
 
Posts: 1333
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: GetExcelRange ERROR

Postby nageswaragunupudi » Mon Sep 20, 2021 5:16 am

Yes, Thanks Mr. Anser
FWH has function for reading Excel with ADO
Code: Select all  Expand view  RUN

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

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

Re: GetExcelRange ERROR

Postby Silvio.Falconi » Mon Sep 20, 2021 8:04 am

nageswaragunupudi wrote:Yes, Thanks Mr. Anser
FWH has function for reading Excel with ADO
Code: Select all  Expand view  RUN

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


thanks Mr Nages,
I tried with
Code: Select all  Expand view  RUN
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 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: 7075
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 60 guests