Focal Point
Execute a macro in an Exl2k template - solved

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

August 10, 2011, 11:59 AM
PBrightwell
Execute a macro in an Exl2k template - solved
We have a program that creates a report in an Excel Template. There is a macro in the template to hide the formulas and supporting reports and just leave the template report. Is there a way to automatically execute the macro from WebFOCUS when the template loads or from Excel when the document is opened?

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


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
August 10, 2011, 12:19 PM
Tony A
Hi Pat,

To do this I use a post process to run workbook_open.

I wrote an article recently on being able to still use Excel 2007 templates where the macros are removed on saving by MS. The article uses VB Scripting on the server to achieve the goal but I know that you use a few different O/S? It might give you food for thought?

You can find the article in the developer centre - link

Good luck

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
August 10, 2011, 04:09 PM
MarciaDrummond
Yes there is!

In the template, copy/create the desired VB script into a module with a specific name: auto_open.

When WebFOCUS populates the template, and before the output is displayed in the user's browser, the script will have already run. This works for MS Excel 2000 and 2002 and possibly higher.

Marcia


WebFOCUS 7.73
Windows, Unix, AS/400 (iSeries)
HTML, PDF, MS Excel (including templates), HTML Active Reports