I'm quite nervous about posting a question, as I know some people respond quite harshly! But I'm quite desperate for help - I have raised a case, but have been told that it is an issue on the macro side.
I'm no expert and that's why I'm asking for help ... please be kind :-)
I have used the code almost exactly (I called my .mht EXCEL_MHT.mht instead of EXCEL_TEMPLATE; and in the macro I put the name of our server). I created a EXCEL_MHT.fex and EXCEL_MHT.mht which are both stored in the apps\bi folder. This folder is mapped in the application path.
When I run the .fex, the data is correctly displayed in the spreadsheet in a WFServlet. But when I click on the button to update the CAR table in webfocus, then I get a message saying that EXCEL_MHT.mht cannot be found.
So if I understand correctly: The .fex can find the .mht and uses it to display the data in the WFServlet. However, when clicking the button on the WFServlet, it cannot find the .mht. Could somebody please help me in getting the data to be written back to the table? We don't have MAINTAIN.
The strange part: Yesterday on my work PC, if I had the .mht open and then ran the process, it worked, and I managed to successfuly update the CAR table. However, today I am working remotely on the laptop and it won't work even if I have the .mht open!
The .fex is as follows:
-GOTO &GOTO_LABEL
-REPORT
TABLE FILE CAR PRINT COUNTRY CAR MODEL BODYTYPE RETAIL_COST DEALER_COST COMPUTE MARGIN/D5.2 = (RETAIL_COST - DEALER_COST) / DEALER_COST;
ON TABLE PCHOLD FORMAT EXL2K FORMULA TEMPLATE 'EXCEL_MHT' SHEETNUMBER 2
END
-EXIT
-INSERT
-IF &COUNTRY.EXISTS NE 1 THEN GOTO NODATA;
MODIFY FILE CAR FREEFORM COUNTRY CAR MODEL BODYTYPE DEALER_COST RETAIL_COST MATCH COUNTRY CAR MODEL BODYTYPE ON NOMATCH REJECT ON MATCH UPDATE DEALER_COST RETAIL_COST DATA
Regards, JanineThis message has been edited. Last edited by: <janine>,
July 22, 2009, 11:51 AM
<JG>
Janine, there are quite a lot of differences between your code and the example written by Mario Delgado in the Winter 2007 WebFOCUS news letter which I assume is what you have based your code on.
I would start by going back to Mario's original code and get that to work.
July 23, 2009, 07:27 AM
Lucas
[quote=janine]The strange part: Yesterday on my work PC, if I had the .mht open and then ran the process, it worked, and I managed to successfuly update the CAR table. However, today I am working remotely on the laptop and it won't work even if I have the .mht open! [/quote]
I think you were not able to make it work remotely because the xmlhttp object is not allowed to make cross domain calls. When you were working remotely and if the excel spreadsheet was on the remote machine you more than likely were trying to do something the xmlhttp object is not allowed to do for security reasons. Now if you had the spread sheet on a local machine (inside the network) and you 'remoted' to that machine and ran it from that machine it should work fine (like it already has). Just a guess but I would sure take a look at that.
7.6.6 Mainframe 7.6.4 Web Focus Windows
July 29, 2009, 04:04 AM
<janine>
Hi
Thanks for the tips JG and Lucas. I am back at work today and will follow your advice. Will keep you posted.
Thanks, Janine
July 29, 2009, 05:41 AM
<janine>
Hi
The code as such was correct ... my error (yes very embarrassing) was that I had used a Button from the forms toolbar instead of using the Command Button from the VB toolbar.
The forms Button kept defaulting the on_action to include a prefix of "EXCEL_MHT.mht" before the sub, which is why the code was expecting the .mht to be open.
Now that I am using a Command Button, the program works.
Thanks for your time.
Regards, Janine
February 21, 2012, 09:15 AM
ChristianP
Hi, can anybody gice me the newsletter from Mr. Delgado the link does not work anymore!! "Excelling With WebFOCUS: Updating Server Data from a WebFOCUS Excel Template "
Regards
Christian
WF Production Version: 7.7.02M WF Test Version: 7.7.02M Developer Studio: 7.7.02 HTML, EXL2K, FLEX, PDF,PPT
Hi, sorry for refreshing this post!! I get the same error message as janine "EXCEL_MHT.mht cannot be found" and i used a button from vba toolbar. I use excel 2007 for building the mht. Could this be the reason?? i followed strictly Mr. Delgado,s example!!
Christian
WF Production Version: 7.7.02M WF Test Version: 7.7.02M Developer Studio: 7.7.02 HTML, EXL2K, FLEX, PDF,PPT
February 22, 2012, 08:20 AM
CLH
Hi,
You need to use excel 2003 to update/create mht files as they are not a fully supported feature in Office 2007
Here is the statement from microsoft
Single File Web Page (*.mht; *.mhtml) Excel 2007 no longer stores Excel-specific feature information in this file format. You can open a file in this format, preserving any Excel-specific features that were created in an earlier version of Excel. However, you can save such a file (or any other workbook) in this file format for publishing purposes only.