Focal Point
exl2k to blackberry - cscript error

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/8451095532

July 05, 2007, 02:34 PM
getit
exl2k to blackberry - cscript error
I was searching a previous thread and found that we have to use vbscript to save the exl2k resulting file as excel file and then send it to blackberry. I have tried that and it is not working for me..? Anyone has any suggestion..?

I have tried microsoft suggestion of creating registry enrtries
HKEY_USERS.DEFAULTSoftwareMicrosoftWindows Script Host
HKEY_USERS.DEFAULTSoftwareMicrosoftWindows Script HostSettings
and making sure user has read permissions but no luck.

Here is the error I get.

--------------------------------------------------------------------------------

No HTML Output!

--------------------------------------------------------------------------------


CScript Error: Loading your settings failed. (Access is denied. )
0 NUMBER OF RECORDS IN TABLE= 5 LINES= 5
0 EXL2K FILE SAVED ...


My Fex..,
FILEDEF REP1 DISK C:\TEMP\REP1.XLS
CMD CSCRIPT.EXE app/saveasxl.vbs
TABLE FILE CAR
PRINT COUNTRY
ON TABLE HOLD AS REP1 FORMAT EXL2K
END


The code in the saveasxl.vbs is the following,

' WebFocus saves an Excel spread sheet
' as a Excel Format Type Html
' This causes a problem when the xls file
' is opened by DTS.
' This scripts opens the xls file then
' saves it as FormatType xls
' LVW - 09/28/03

Dim WshShell
Dim CmdArgs
Dim Inputfile
Dim Outputfile

Dim xlApp
Dim xlBook
Dim xlSheet

set WshShell= WScript.CreateObject( "WScript.Shell" )
Set CmdArgs = WScript.Arguments

Inputfile = CmdArgs(0)
Outputfile = CmdArgs(1)

Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Open(Inputfile)

xlbook.SaveAs Outputfile , 1

xlApp.Quit

Set xlSheet = Nothing
Set xlBook = Nothing
Set xlApp = Nothing


App Studio Version 8202
windows Platform
SQL Server 2008/2012
July 06, 2007, 02:32 AM
Tony A
A couple of things,

1. does cscript.exe know what app/saveasxl.vbs is? Should it not be the full path to the vbs file?

2. Within your vbscript you are referencing CmdArgs(n) but are not passing any command arguements.

Do you understand what your vbscript is trying to achieve or did you just pull the script from a previous posting? - prior posting

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 
July 06, 2007, 04:55 PM
getit
Tony,
I just pulled the script from previous posting.
Thanks for looking into this.
I am still getting error even if I pass arguments and give the full path.
Lets say I have a rep1.xls on my compute c drive.
If I also save the script on C drive and run it..it is giving me the following error.


cscript.exe saveasxl.vbs (c:\rep1.xls,c:\rep2.xls)

C:\Documents and Settings\Administrator>cd c:\

C:\>cscript.exe saveasxl.vbs(DaliyOrdersReport.xls,Daily.xls)
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

Input Error: There is no script engine for file extension ".xls)".

C:\>cscript.exe saveasxl.vbs(DaliyOrdersReport,Daily);
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

Input Error: There is no script engine for file extension ".vbs(DaliyOrdersRepor
t,Daily);".

C:\>


App Studio Version 8202
windows Platform
SQL Server 2008/2012
July 09, 2007, 12:29 PM
getit
Nevermind. Got this figured out.
Thanks.


App Studio Version 8202
windows Platform
SQL Server 2008/2012