Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Running a macro using web focus code (Excel 2k )

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Running a macro using web focus code (Excel 2k )
 Login/Join
 
Gold member
posted
Is there any way of running a macro through webfocus code when generating reports in excel format?
I have created a .mht file which includes a statement to directly print the report output: "ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True" and this .mht file is referred to in my ON TABLE PCHOLD statement. But the result is: when i run my report, i do get the output in excel format and then when i go to Tools->Macro->Macros and then run the macro(the macro does appear), the output is getting printed. Is there any way such that when my excel output gets generated, at the same time, the macro is run ?

This message has been edited. Last edited by: Kerry,
 
Posts: 78 | Registered: December 11, 2005Report This Post
Expert
posted Hide Post
CD,

You will need to identify a suitable event to use. Not sure what it might be. Have you tried an Excel forum?



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, 2004Report This Post
Gold member
posted Hide Post
CD,

Are you wanting your .mht to auto-run the macro when the report opens in Excel so that it brings up the print dialogue window to print the spreadsheet?

Dennis


Local: AppStudio 8.2.03 - Win7 - Tomcat Server: WebFOCUS 8.2.03 - Windows 2008 R2 Enterprise on VMWare 2 CPU, 3.2GHz, 4GB of RAM Output Formats: HTML, Excel, PDF, PPT, Active Reports
 
Posts: 38 | Location: Denver, CO | Registered: March 16, 2005Report This Post
Gold member
posted Hide Post
Yes, this is something similar to what I want. The .mht should auto-run the macro when the report opens in Excel so that it automatically gives the print out and doesnt even bring up the print dialogue window.
 
Posts: 78 | Registered: December 11, 2005Report This Post
Master
posted Hide Post
Actually I am doing something like this right now. I saved a .mht in baseapp on the Reporting Server. I wrote a macro to do some formatting, turning filters on, freeze panes, etc. Just name the macro Auto_Open. Seems to work fine.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006Report This Post
Member
posted Hide Post
 
Posts: 22 | Registered: October 13, 2006Report This Post
Virtuoso
posted Hide Post
running a macro in excel just to get the report printed is a strange way to work.
I would give the report directly into PDF, no user can influence the layout anymore.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Expert
posted Hide Post
Is there a setting within Excel which automatically sets the column width to a minimum based on the contents, similar to double-clicking the column dividers? Something other then an macro which is close to automatic but not directly automatic unless we do some work and implement that on the users machines. Having the users change a setting within Excel is acceptable. OK, maybe a macro which we can, through WebFOCUS PCHOLD, automatically execute.
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Virtuoso
posted Hide Post
This basic Excel VBA routine selects all cells in the worksheet and "commands" them to auto-fit their contents:

Sub ColumnWidth()
' Keyboard Shortcut: Ctrl+Shift+W
    Cells.Select
    Selection.Columns.AutoFit
End Sub


You could make it part of a file that can be later used as a template, or attempt to use the technique outlined in ibidevelop's reference above.

The routine can of course be improved to capture the current Worksheet and Cell/Range selected before any changes are made, and re-select them after the columns have been adjusted.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
The "manual" steps to make that happen in Excel are:

1. Select all cells (by clicking the empty area where row and column labels intersect)
2. Choose the following options from the menu: Format -> Column -> Autofit Selection

That's what I and some business users at my site do. As we are still using WebFOCUS 5.3.4 the use of Excel Templates is not a feasible option at the time.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Running a macro using web focus code (Excel 2k )

Copyright © 1996-2020 Information Builders