As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
I have the need to create an excel spreadsheet that has a macro in it, and I also need to create a second tab in addition to this.
I am using WF 8.0.0.7 and in the past I have created an excel spreadsheet using EXL07 and creating a macro with one sheet, and that worked fine.
Now, and I know I said in the subject for EXL2K, but it doesn't matter if I create it in EXL2K or EXL07, as long as I can get it to work.
I referenced an older post here from, I think 2013 about temporary templates, and how to do it, but I haven't been able to get that solution to work.
So here below is the code I am using (from the CAR file).
Thanks.
FILEDEF TEST DISK test.mht
-RUN
TABLE FILE CAR
SUM DEALER_COST
BY BODYTYPE
BY CAR
ACROSS MODEL
ON TABLE HOLD AS TEST FORMAT EXL2K TEMPLATE 'macro2003.xlsm' SHEETNUMBER 1
END
-RUN
FILEDEF TEST2 DISK TEST2.MHT
-RUN
TABLE FILE CAR
PRINT *
BY CAR
ON TABLE PCHOLD AS TEST2 FORMAT EXL2K CLOSE TEMPLATE 'TEST' SHEETNUMBER 1
END
-RUN
-EXIT
I read in the WF 8.0 manual that the .mht file needs to say X-Document-Type: Workbook in line 2 when edited in notepad, and I am seeing that when I edit it.
Not sure why I keep getting the following error: (FOC3289) TEMPLATE FILE: Error opening file (FOC009) INCOMPLETE REQUEST STATEMENT BYPASSING TO END OF COMMAND
Any help would be appreciated.
Thanks.
PaulThis message has been edited. Last edited by: FP Mod Chuck,
First of all, you're mixing EXL2K templates and XLSX (EXL07) templates.
The ".mht" file is a web archive type file that was used for EXL2K templates.
The ".xlsm" file would be an XLSX template file that includes macros.
Also, do not forget to change the SHEETNUMBER between sections otherwise you'll end up over-writing your worksheet outputs.
Consider the following code, the initial template file (exl07_template.xltm) must exist within your APP PATH. The first table request uses this file as a starting point and inserts the output into sheet 1 (because of SHEETNUMBER 1 syntax). The AS filename (CAR1) causes a file "car1.xlsm" to be created (within EDATEMP).
The "car1.xlsm" is then used as the template for the second table request which pushes the output into sheet 2 (because of SHEETNUMBER 2 syntax). The output is then saved as "car2.xlsm" which is used as input into the next table request.
... and so on.
The final table request, adds the output to sheet 3 (because of SHEETNUMBER 3 syntax) then sends the output back to the users browser as "exl07_output_20180308_nnnnnn.xlsm" (in the version that I am using - 8.2.01).
SET EMPTYREPORT = ON
TABLE FILE CAR
SUM RCOST
DCOST
BY COUNTRY
BY CAR
BY MODEL
WHERE COUNTRY EQ 'ENGLAND'
ON TABLE HOLD AS CAR1 FORMAT EXL07 TEMPLATE 'exl07_template.xltm' SHEETNUMBER 1
END
-RUN
TABLE FILE CAR
SUM RCOST
DCOST
BY COUNTRY
BY CAR
BY MODEL
WHERE COUNTRY EQ 'ITALY'
ON TABLE HOLD AS CAR2 FORMAT EXL07 TEMPLATE 'car1.xlsm' SHEETNUMBER 2
END
-RUN
TABLE FILE CAR
SUM RCOST
DCOST
BY COUNTRY
BY CAR
BY MODEL
WHERE COUNTRY EQ 'W GERMANY'
ON TABLE PCHOLD AS exl07_output FORMAT EXL07 TEMPLATE 'car2.xlsm' SHEETNUMBER 3
END
-RUN
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
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004
It is usually the little things that stump me; like when the template says SHEETNUMBER 1 and SHEETNUMBER 2 - I thought that my macro only needed to have a sheet 1 since that is where my macro was. I didn't even have a sheet2 in the .xlsm file (I used .xlsm instead of .xltm).
Once I created a sheet2 in my macro it worked like a charm.
I had thought that it would be automatically created by WF on the second step where SHEETNUMBER 2 was, but I was wrong.
Anyway, long story short, I got it to work and I do appreciate your help.