Page 1 of 1

Create Excel Workbooks in Mod_Harbour

PostPosted: Mon Jul 12, 2021 9:34 pm
by byron.hopp
Is it possible to access Excel via OLE on Mod_Harbour running on IIS. Any example programs?

Thanks,

Byron ...

Re: Create Excel Workbooks in Mod_Harbour

PostPosted: Tue Jul 13, 2021 6:33 am
by Antonio Linares
Byron,

This works fine with IIS + mod_harbour

Code: Select all  Expand view
function Main()

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

   ? oExcel:ClassName()

return nil

Re: Create Excel Workbooks in Mod_Harbour

PostPosted: Tue Jul 13, 2021 6:51 am
by byron.hopp
Sweet.

Thank you,

Re: Create Excel Workbooks in Mod_Harbour

PostPosted: Tue Jul 13, 2021 7:29 pm
by Massimo Linossi
Hello Antonio,
can this command work with FastCgi too ?
And what are the methods and classes that can be called ?
Thanks a lot

Re: Create Excel Workbooks in Mod_Harbour

PostPosted: Tue Jul 13, 2021 7:38 pm
by byron.hopp
All,

What is, or is there a difference between:

Win_OleCreateObject

and

CreateObject

functions...

Byron,

Re: Create Excel Workbooks in Mod_Harbour

PostPosted: Wed Jul 14, 2021 2:13 pm
by Antonio Linares
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

Re: Create Excel Workbooks in Mod_Harbour

PostPosted: Wed Jul 14, 2021 2:15 pm
by Antonio Linares
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

Re: Create Excel Workbooks in Mod_Harbour

PostPosted: Wed Jul 14, 2021 5:08 pm
by Massimo Linossi
Hi Antonio,

Code: Select all  Expand view

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 ?

Re: Create Excel Workbooks in Mod_Harbour

PostPosted: Thu Jul 15, 2021 10:18 am
by Antonio Linares