delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/06/16/09:28:17

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:subject:date:message-id:content-type
:content-transfer-encoding:mime-version; q=dns; s=default; b=JTJ
c6lragDPHSgrgbkgT5D/jfqWmruqlv2MsZYn/i1TfoHPAFvLQiaYs7zMSoUrGX2q
cDVJJgEAx6zN20l5ZsnlDM/mNI3rdAfw3NOgcliz7KINKk9L9oYZqGan62bdbrab
eonq2mo9jnRLhJDjCWpm108dilaEF/ME3izTSgD0=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:subject:date:message-id:content-type
:content-transfer-encoding:mime-version; s=default; bh=vdsFDOwWU
lMDct8iegLWhixj3BA=; b=fAngZBaKx+vG0XUHpQZAI+mcIA+7E/84Ssio8ukYC
C2IFIudnvR5ySkcuASaljsK/XubFnLgIlGbr3Vf3ble7eXpzrR2ecjjT8QLjPFnD
WIYmee/nxOuczShuIHo5DEnhEATeeU2EUtb09cNPbR45K9SgyqtfQZwf9eJ5ake6
cs=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: Yes, score=6.5 required=5.0 tests=AWL,BAYES_50,GARBLED_BODY,KAM_LAZY_DOMAIN_SECURITY,MIME_CHARSET_FARAWAY,RP_MATCHES_RCVD autolearn=no version=3.3.2
X-HELO: smtp-fr.alcatel-lucent.com
From: "Kertz, Denis (D)** CTR **" <d DOT kertz AT alcatel-lucent DOT com>
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Subject: Unable to run excel via cron
Date: Tue, 16 Jun 2015 13:27:48 +0000
Message-ID: <883F2CBBC85A62419E181EB2F0ECF21F45DE3251@US70UWXCHMBA04.zam.alcatel-lucent.com>
x-cr-puzzleid: {9676CA7D-EF4D-4822-A835-60909D61225D}
x-cr-hashedpuzzle: CEvn CYOS C6D6 DKbw DUTx DymX ENVv EsEH E1nm E/rz FHo8 FkJr GDmm GEd5 GWtQ G/uF;1;YwB5AGcAdwBpAG4AQABjAHkAZwB3AGkAbgAuAGMAbwBtAA==;Sosha1_v1;7;{9676CA7D-EF4D-4822-A835-60909D61225D};ZAAuAGsAZQByAHQAegBAAGEAbABjAGEAdABlAGwALQBsAHUAYwBlAG4AdAAuAGMAbwBtAA==;Tue, 16 Jun 2015 13:27:42 GMT;VQBuAGEAYgBsAGUAIAB0AG8AIAByAHUAbgAgAGUAeABjAGUAbAAgAHYAaQBhACAAYwByAG8AbgA=
MIME-Version: 1.0
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id t5GDSBMa001065

We need to run some Excel programs via cron and are using vbscript to do this. šWe have this running on a WinXP machine but are having trouble running on a Win7 machine, but we don't think it is a Win7 problem. 

Here's the script to run a simple test excel program: 

Dim xlApp 
Dim xlWb 
Set xlApp = CreateObject("Excel.application") 
xlApp.Visible = True 
Set xlWb = xlApp.workbooks.Open("c:\Shared\Prospect\Bin\TestExcel.xls") 
xlApp.Quit 
Set xlWb = Nothing 
Set xlApp = Nothing 

Here's how we run this test script from a terminal command prompt: 

c:/Windows/System32/wscript.exe 'c:\cygwin64\home\<cygwinLogin>\tst.vbs' 

This runs fine from a command line prompt but hangs when run as a cron job. šWe have trapped the error message we get when the workbooks.Open is executed and get this: 

Microsoft Office Excel cannot access the file 'c:\Shared\Prospect\Bin\TestExcel.xls'. There are several possible reasons: 

‘ The file name or path does not exist. 
‘ The file is being used by another program. 
‘ The workbook you are trying to save has the same name as a currently open workbook. 

We don't believe any of these possible reasons apply. šIn particular, since it looked like this could be a permission issue, we changed the vbscript to simply copy the TestExcel.xls file and that works fine:

dim filesys
set filesys=CreateObject("Scripting.FileSystemObject")
If filesys.FileExists("c:\Shared\Prospect\Bin\TestExcel.xls") Then
ššššššš filesys.CopyFile "c:\Shared\Prospect\Bin\TestExcel.xls", "c:\cygwin64\home\<cygwinLogin>\"
Else
ššššššš WScript.Echo "file does not exist"
End If

This hanging also happens if we create a new spreadsheet and try to save it (and this works fine from a command line prompt). šSo we can run excel programs from a cron job as long as we don't open an excel program or save a spreadsheet, which means it is useless. 

We also have a couple of other Win7 PCs. šThis problem happens on 2 of the 3 Win7 PCs but works on one of the Win7 PCs. šAll 3 PCs are running Excel 2007 SP3.š Two of these 3 PCs have the exact same version of Excel 2007 and one works and the other doesn't.

Anybody have any idea what could be going on here? šWe only have this cron job problem when running an excel program via vbscript. šWe haven't had any cron job problems with other non-excel scripts. 

Denis

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


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019