Focal Point
[CLOSED] Can webfocus call an Excel macro and get a return value?

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4237062196

April 25, 2019, 08:58 AM
RichM
[CLOSED] Can webfocus call an Excel macro and get a return value?
I wanted to know, if Webfocus can call an Excel macro that returns a value. For example, the macro is a function that does some math. When the macro is done, it returns a number. Can webfocus call that Excel macro and use the number it returns? If so, what's the webfocus syntax.

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8
Windows, All Outputs
April 25, 2019, 09:08 AM
BabakNYC
I doubt it but what's the specific use case? Excel isn't a DBMS but there might be a hack for what you're trying to do.


WebFOCUS 8206, Unix, Windows
April 25, 2019, 12:44 PM
RichM
So Webfocus calls the Excel Macro and passes a parameter which is a number. The Excel function crunches some numbers and returns a value.

So basically, I want to send the Excel Macro a number and when it's done, get a number back.


WebFOCUS 8
Windows, All Outputs
April 25, 2019, 12:52 PM
BabakNYC
I know you can do this using an SP in SQL Server.


WebFOCUS 8206, Unix, Windows
April 26, 2019, 11:57 AM
jgelona
Why can't you use DEFINE FUNCTION in WebFOCUS? What math are you trying to do? If it is not some native to WebFOCUS (like doing differential equations), you can always create your own user written subroutine in another language, compile it, and make it part of your installation. It has been over 25 years ago, so the memory is fuzzy, but I did something like this in PC FOCUS for DOS, so I'm pretty sure that it can still be done. I had an application for a company that does shipping on the Great Lakes and we had a user written subroutine written in Fortran that we'd call to tell us if a ship with X amount of cargo A and Y amount of cargo B would go through the locks on the lakes. It was passed the number and it would calculate the ships displacement (how low/high in water the cargo would make the ship).

Another example is RSTAT. Using RSTAT creates a function written in C, which gets compiled and stored on the Reporting Server. You call it just like any other FOCUS language functions like EDIT, STRREP, etc.

This message has been edited. Last edited by: jgelona,


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.