FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index mod_harbour Create Excel Workbooks in Mod_Harbour
Posts: 408
Joined: Sun Nov 06, 2005 03:55 PM
Create Excel Workbooks in Mod_Harbour
Posted: Mon Jul 12, 2021 09:34 PM

Is it possible to access Excel via OLE on Mod_Harbour running on IIS. Any example programs?

Thanks,

Byron ...

Thanks,

Byron Hopp

Matrix Computer Services
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Create Excel Workbooks in Mod_Harbour
Posted: Tue Jul 13, 2021 06:33 AM
Byron,

This works fine with IIS + mod_harbour

Code (fw): Select all Collapse
function Main()

   local oExcel := win_OleCreateObject( "Excel.Application" )

   ? oExcel:ClassName()

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 408
Joined: Sun Nov 06, 2005 03:55 PM
Re: Create Excel Workbooks in Mod_Harbour
Posted: Tue Jul 13, 2021 06:51 AM

Sweet.

Thank you,

Thanks,

Byron Hopp

Matrix Computer Services
Posts: 512
Joined: Mon Oct 17, 2005 10:38 AM
Re: Create Excel Workbooks in Mod_Harbour
Posted: Tue Jul 13, 2021 07:29 PM

Hello Antonio,
can this command work with FastCgi too ?
And what are the methods and classes that can be called ?
Thanks a lot

Posts: 408
Joined: Sun Nov 06, 2005 03:55 PM
Re: Create Excel Workbooks in Mod_Harbour
Posted: Tue Jul 13, 2021 07:38 PM

All,

What is, or is there a difference between:

Win_OleCreateObject

and

CreateObject

functions...

Byron,

Thanks,

Byron Hopp

Matrix Computer Services
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Create Excel Workbooks in Mod_Harbour
Posted: Wed Jul 14, 2021 02:13 PM
Dear Massimo,

Massimo Linossi wrote:Hello Antonio,
can this command work with FastCgi too ?
And what are the methods and classes that can be called ?
Thanks a lot


Yes, it should, as that function is provided from Harbour's hbwin.lib and it is linked inside mod_harbour

DATAs and Methods of OLE objects are different for each used OLE object (that belongs to a different OLE class)

In these forums you find many examples for using Excel
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Create Excel Workbooks in Mod_Harbour
Posted: Wed Jul 14, 2021 02:15 PM
Dear Byron,

byron.hopp wrote:All,

What is, or is there a difference between:

Win_OleCreateObject

and

CreateObject

functions...

Byron,


Win_OleCreateObject is provided by Harbour's contrib hbwin.lib

CreateObject() is provided by FWH
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 512
Joined: Mon Oct 17, 2005 10:38 AM
Re: Create Excel Workbooks in Mod_Harbour
Posted: Wed Jul 14, 2021 05:08 PM
Hi Antonio,

Code (fw): Select all Collapse
Sheet1 Error: Argument error
operation: SAVE
[ 1] = C c:/temp/Export_Excel.xlsx
[ 2] = N 51
called from: WIN_OLEAUTO:SAVE, line: 0
called from: pcode.hrb, MAIN, line: 64
called from: HB_HRBDO, line: 0
called from: ..\source\exec.prg, EXECUTE, line: 70

Source:
0062:
0063:
0064 =>oWorkBook:Save(nomefile, 51)
0065: oWorkBook:Close(.T.)
0066: oExcel:Quit()


What is the correct sintax for saving a file in Excel ?
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Create Excel Workbooks in Mod_Harbour
Posted: Thu Jul 15, 2021 10:18 AM
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion