January 12, 2009, 10:24 PM
WFLurkerExcel Template with VB Macro and Freeze Pane
I have an excel template with simple VB macro to do auto filter on the first 3 columns and a freeze pane.
First I tried creating MHT file and using
ON TABLE PCHOLD FORMAT EXL2K TEMPLATE 'exlfil3' SHEETNUMBER 1
I was able to get an output from the template but without the marco or freeze pane. I assume this is because the format of the output is *.xht .
How do I get the output to be *.xls instead which I assume would have the marco and freeze pane?
I created the template in *.xls format and put it on the local http server (http://localhost/approot/baseapp)
If possible how do you code it to write to the xls template?
January 13, 2009, 02:24 AM
Tony ALurker,
Within the forum, there are many examples of how templates should used and how they should be created. However -
1. Open excel and add your macros, ensuirng that you have at least two worksheets within your workbook.
2. Click File / Save As and choose "single file web page" as the type - leave the extension as .mht.
Choose a location on your reporting server and in a folder that is included within your APP PATH.
3. In your fex you may or may not have to filedef the template file but the syntax that you give is correct.
WebFOCUS does not create "pukka" Excel files, rather a version of xmlns that is able to be read by MS Excel. If you want it to be MS Excel format then you will have to perform a Save As, specifying the format that you require. As you are performing a PCHOLD the actual format of the file doesn't really matter until you save it, which the User would have to do (or you could prompt them via your macros).
T
January 13, 2009, 02:31 AM
Tony A... and remember, search functions on the internet are much better than they used to be, you only have to use them.
Use the search link top right or alternatively
click thisT
January 13, 2009, 02:49 AM
<JG>1st question, what version of excel are you using?
If it is 2007 then you are out of luck as it only works if the template is created in an earlier release.
.xht works just fine with templates and VB macros providing you take note of the above and the rule
that the template file must have at least 2 worksheets and both must have at least 1 cell containing
something, even a single space.