FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How to call VBA methods in FiveWin
Posts: 408
Joined: Sun Nov 06, 2005 03:55 PM
How to call VBA methods in FiveWin
Posted: Mon Oct 01, 2012 07:07 PM

I run across this when using Microsoft Office programs where I am utilizing OLE to control them.

How do I call this:

oExcel:ActiveWorksheets:QueryTables:Add(Connection:="TEXT;C:\MyFile.txt", Destination:=Range("$A$1"))

The way the parameters are passed is different, is there a way around this?
I can't get this to work.

Byron ...

Thanks,

Byron Hopp

Matrix Computer Services
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: How to call VBA methods in FiveWin
Posted: Mon Oct 01, 2012 07:46 PM

No, you have to use positional method. You can use OLEDEFAULTARG() for the empty parameters.

EMG

Posts: 408
Joined: Sun Nov 06, 2005 03:55 PM
Re: How to call VBA methods in FiveWin
Posted: Mon Oct 01, 2012 08:06 PM

EMG,

I looked in my documentation for xHarbour, and FiveWin and cannot find OrgDefaultArg().

I include this in my project and my link fails. What Lib is this in?

Also how does this work, it is not obvious how to utilize this function.

Thanks,

Byron...

Thanks,

Byron Hopp

Matrix Computer Services
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: How to call VBA methods in FiveWin
Posted: Mon Oct 01, 2012 08:37 PM
byron.hopp wrote:EMG,

I looked in my documentation for xHarbour, and FiveWin and cannot find OrgDefaultArg().


Maybe you have mistyped the function. The correct name is

Code (fw): Select all Collapse
OleDefaultArg()


It's inside rtl.lib. Use it for empty parameters:

Code (fw): Select all Collapse
MyOleObj:MyOleMethod( Param1, OleDefaultArg(), Param3, etc. )


EMG

Continue the discussion