This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Problems running a vbscript from cron


Hi All,
I have written a simple vbscript. Its purpose is to convert an excel .xls file to .csv.
The script runs fine under Cygwin.
> cscript xls2csv.vbs myexcel.xls myexcel.xls


I am trying to get the script to be run every night by setting up a cron job. I have the cron service running and ive added a mycron.bash file to my crontab file.
Cron is running fine and it is running mycron .bash file. The .bash file runs the vbscript as follows
cscript xls2csv.vbs myexcel.xls myexcel.xls


The problem i have is that the vbscript gives an error stating i dont have permissions to open the excel application.
Microsoft /VBScript/ runtime error: /Permission denied


/If i run the my .bash file from a Cygwin BASH shell it runs fine.

Any suggestions on how to go about debugging this?

Im running on Windows NT. Windows shell 5.6.

Thanks
Derek

This is the xls2csv.vbs. It falls over on line 5
Dim ArgObj
Set ArgObj = WScript.Arguments
xlsPath = ArgObj(0)
csvPath = ArgObj(1)
Set objExcel = CreateObject("Excel.Application")
objExcel.DisplayAlerts = 0
set workbook = objExcel.workbooks.open(xlsPath)
const xlCSV = 6
dim sheet
for each sheet in workbook.worksheets
  sheet.activate
  workbook.saveAs csvPath, xlCSV
next
objExcel.Quit
WScript.quit


-- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]