X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=1.0 required=5.0 	tests=AWL,BAYES_00,J_CHICKENPOX_64,J_CHICKENPOX_74,SPF_PASS
X-Spam-Check-By: sourceware.org
Message-ID: <49E772BE.3020408@gmail.com>
Date: Thu, 16 Apr 2009 19:02:38 +0100
From: Derek Wallace <del.wallace@gmail.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.8.1.19) Gecko/20081204 SeaMonkey/1.1.14
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Problems running a vbscript from cron
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

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/

