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 VB Script From Reportcaster

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Running VB Script From Reportcaster
 Login/Join
 
Gold member
posted
I am currently in the process of incorporating the tips in Anthony Alsford's excellent Focal Point tip regarding Excel Templates, but I am running into an issue.

I am using Dialogue Manager to create a VB Script file to change the Excel file from a Single Web Page to an Excel Worksheet, among some other things. I can run the script manually from my PC and from a fex, and from the server itself. I have also been able to, with the creation of a .BAT file, run the script from the Windows Task Scheduler on the server.

However, I am not able to run the script file from a fex in Reportcaster. The script is not getting past the command:

 
Set objWBook = objExcel.Workbooks.Open("e:\Webf77\ibi\apps\mgmtdash\excelfile.xls")


We have played around with folder permissions and different ways to open up access to the file with no luck.

I know this probably isn't a WebFOCUS issue, but I am wondering if anyone might have some tips for me to help resolve this.

Thanks!

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


WebFOCUS 8
 
Posts: 74 | Location: Gahanna, OH | Registered: September 22, 2009Report This Post
Expert
posted Hide Post
When I wrote that article I was working on a stand alone system (still with servers installed and not just DS server) and my own local environment which had minimal security. The things that I found were generally down to MS Excel not wanting to open a file because it considered it "already open", so introducing a delay in processing might help if that is the problem. As you have managed to run the .BAT created on it's own outside of WF then this may well be the problem that you have.

The only other suggestion I have is to locate the files outside of the APP folders.

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 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Member
posted Hide Post
Did you find any solution for this issue?

We are exctly at this point with no luck at all.

When WebFocus runs the vbScript and try to open the file, it fails.

The most atonishing thing is that I've a check control for the file to exists, and it says that exist, but later when excel tries to open the file, it is sending that doesnt exist or is locked by another process... but both options seems false at all

I'm nut whith this issue.

There isn't security permissions (I've checked that user:SYSTEM has granted permisions for this folder)

And when I run this vbs manually it goes without any problem....


Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objExcel = CreateObject("Excel.Application")



'Control de error de aplicacion
if Err.Number <> 0 then
Wscript.Echo "Excel application not installed."
Wscript.Quit
else
Wscript.Echo "Excel application is installed."
end if

objExcel.DisplayAlerts = False 'Esto evita mostrar el box de pregunta
objExcel.Visible = True

excel_file_1 = "E:\ibi/apps/edarpc/Scriptx.xls"


If objFSO.FileExists(excel_file_1) Then

WScript.Sleep 100
Wscript.Echo "File exists"
WScript.Sleep 100

objExcel.Workbooks.Open(excel_file_1)


WF 8.1
Windows Server 2008
SQL Server 2012
 
Posts: 24 | Registered: September 04, 2013Report This Post
Expert
posted Hide Post
Vitoto,

If you have run this a couple of times unsuccessfully then you may find a CMD process still running on the server which is effectively locking those files. There may even be an MS Excel thread still active.

Also, as you are on WF8 have you looked at using EXL07 Templates? Or are you already doing this? If so be aware that my article was written using EXL2K and I haven't played with the EXL07 versions.

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, 2004Report This Post
Member
posted Hide Post
Hi Tony!

We arent using any template.

We just use the vbs language to fill certains areas of the excel file, but it is not a template, just an xls file.

And there isnt any cmd process running on the server as the cmd closes when there is an error.

This is the command that calls the script to run

-SET &VBS2 = 'E:\ibi\apps\edarpc\Scriptx.vbs';

CMD &VBS2.EVAL

The issue is that excel says this file is locked, but only when it is executed by webfocus. When I run the script 'manually' ends without any problem


WF 8.1
Windows Server 2008
SQL Server 2012
 
Posts: 24 | Registered: September 04, 2013Report This Post
Expert
posted Hide Post
Vitoto,

Remember that when you run it via WebFOCUS it is NOT interactive - i.e. do not put echo statements as WebFOCUS cannot respond to the OK button in a dialog.
If your VBScript runs without user interaction then it should run OK in WebFOCUS.

Also look at using the SYSTEM command syntax within WebFOCUS - I think that is what I put in the article - to trap the return code from your script file.

Not sure how much I can help you, but 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 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
<CSWDT>
posted
I set up a procedure to do a similar process and was running into all the same issues. The only work around I was able to get working was to create an Administrator profile in Report Caster. If I ran the procedure under anybody other than the administrator, the VBScript got hung up on the opening of the Excel file.

Hope this helps.
 
Report This Post
Member
posted Hide Post
HI CSWDT !!!

Do you mind to tell me how to make this implementation through the admin profile?

If I don't misunderstand you, I have to invoke a Report Caster Task with that admin profile to launch the vbs script (Isn't it?). Could you give me an example please?


WF 8.1
Windows Server 2008
SQL Server 2012
 
Posts: 24 | Registered: September 04, 2013Report This Post
<CSWDT>
posted
Vitoto,

You would go to your webfocus_server:8080/ibi_apps page. Select Managed Reporting Administration. I then created a new user
User ID: administrator
password: xxxxxxxx ("admin" is default unless you have changed the default password.)
Make sure that the administrator user has the report caster abilities to schedule a job.
Log into report caster under the administrator profile, and schedule the job that you are looking to execute with the VBScript call.

This should then execute your procedure under the server's administrator profile. It will also execute your VBScript under the administrator as well. Once I set this up I no longer had the issues of my VBScript failing when trying to open the Excel file.

If you have other specific questions please let me know.
 
Report 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 VB Script From Reportcaster

Copyright © 1996-2020 Information Builders