This is the mail archive of the
mailing list for the Cygwin project.
RE: Unable to run excel via cron
- From: "Andy Hall" <fixpertise-consulting at comcast dot net>
- To: <cygwin at cygwin dot com>
- Date: Wed, 24 Jun 2015 08:37:58 -0700
- Subject: RE: Unable to run excel via cron
- Authentication-results: sourceware.org; auth=none
- References: <883F2CBBC85A62419E181EB2F0ECF21F45DE4DA5 at US70UWXCHMBA04 dot zam dot alcatel-lucent dot com> <558A2207 dot 3070206 at cygwin dot com>
> 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.
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.
Here's the .vbs script:
Dim args, objExcel
Set args = WScript.Arguments
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
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()
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple