delorie.com/archives/browse.cgi | search |
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:references:in-reply-to:subject:date | |
:message-id:mime-version:content-type:content-transfer-encoding; | |
q=dns; s=default; b=AQJafSki8t69PZjJGEapOzrpl0mYtUy/bAnCJkfuX8t | |
7Vph10iNu7ERJYgndekmIw/mH8NSbnO72WN+0i2w1cMT99JMm5urKUQpA3EH3GdZ | |
AliRkIbcHDtQjc6sNW3C9zpO6iRqLy/WJb35B4IJ3SnMuRCY86jPD1eupEdG6sAc | |
= | |
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:references:in-reply-to:subject:date | |
:message-id:mime-version:content-type:content-transfer-encoding; | |
s=default; bh=Pc9wLHeAS0LGr5YnbySu1tN0EM8=; b=h5md7UlLkufEAH/5S | |
idmCezZ47HqmkARfW12xIbuFOnJxIvlRU2QQPpHizPBdpkuLrd99bIR8ZjYO3QPD | |
N04XH9JfD1RoJhU+PwpqMldhvPBuQ/bJtGC8JBAZs0mFJH5iPT2XTKrENexZnfI+ | |
UUN1rNqYHtZIXJSmkpuz8qLSyU= | |
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: | No, score=0.7 required=5.0 tests=AWL,BAYES_60,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,SPF_PASS autolearn=no version=3.3.2 |
X-HELO: | resqmta-po-06v.sys.comcast.net |
From: | "Andy Hall" <fixpertise-consulting AT comcast DOT net> |
To: | <cygwin AT cygwin DOT com> |
References: | <883F2CBBC85A62419E181EB2F0ECF21F45DE4DA5 AT US70UWXCHMBA04 DOT zam DOT alcatel-lucent DOT com> <558A2207 DOT 3070206 AT cygwin DOT com> |
In-Reply-To: | <558A2207.3070206@cygwin.com> |
Subject: | RE: Unable to run excel via cron |
Date: | Wed, 24 Jun 2015 08:37:58 -0700 |
Message-ID: | <000601d0ae93$c04be810$40e3b830$@comcast.net> |
MIME-Version: | 1.0 |
X-IsSubscribed: | yes |
> On 06/23/2015 09:39 AM, Kertz, Denis (D)** CTR ** wrote: > > I changed the cron setup to use cygserver as Corinna suggested. I used > > cron-config and cygserver-config to setup the cron and cygserver services > > and passwd -R to establish my password. Normal cron jobs run under this > > setup but Excel still hangs as it did before. I also tried this on the > > Win7 PC that I thought worked at one time but it behaved the same with > > Excel hanging. > > > > So it looks like Corinna's first case is the situation - there is no > > solution. There apparently is something unique about Excel that will not > > run in this Win7 cron environment. > > It's actually not unique to Excel and it's not peculiar to Cygwin's cron. > Any program that requires desktop interaction to run would suffer this same > limitation on Vista and beyond if started from a service. In the Cygwin > environment, cron is run as a service and used to start programs, so it's > the obvious 'culprit' reported here but it's just one of many possible > vectors that exhibit the unwanted behavior on Windows. Just FYI. > > -- > Larry > I think Denis is saying Excel hangs even if it doesn't require user interaction. I.e. it runs some macros and exits. On Win7 Pro, I was able to run the following .vbs script via the task scheduler and have it run the "AddTimeInColumn" macro. The resulting spreadsheet had the times the task was run column A. Andy Here's the .vbs script: Dim args, objExcel Set args = WScript.Arguments Set objExcel = CreateObject("Excel.Application") objExcel.Workbooks.Open("C:\cygwin64\home\Andy\ExcelTest\TestExcel.xlsm") objExcel.Visible = True objExcel.Run "AddTimeInColumn" objExcel.ActiveWorkbook.Save objExcel.ActiveWorkbook.Close(0) objExcel.Quit Here's the macro: Public Sub AddTimeInColumn() Dim LastRowInColumn As Long LastRowInColumn = Cells(Cells.Rows.Count, "A").End(xlUp).Row 'If column is completely blank, need to adjust last row If Cells(LastRowInColumn, "A").Value = "" Then LastRowInColumn = 0 'Insert time in next row Cells(LastRowInColumn + 1, "A").Value = Time() End Sub -- 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
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |