Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


GregAvon
2016-11-29T19:25:46Z
First of all, we really do have Priority Support! We're running VisualCron 8.2.1

VisualCron does not seem to allow you to add a worksheet to an Excel file. Since I can’t install Office on the VisualCron server and do it via a macro, I decided to write a small C# program to do it on a remote machine (let’s call it “clientBox”). When I run the C# program on clientBox, it adds a Sheet1 without a problem. However, when I try to do it via Remote Execute in VisualCron it craps out with

“Exception in Task: System.Exception: Arithmetic operation resulted in an overflow.
Exception in Task: System.Exception: Non zero exit code”


*** The log_server file shows this:


11/29/2016 1:23:49 PM Debug Next Task is: Execute Remote
11/29/2016 1:23:49 PM Debug Calling StartTaskProcess() with Task: Execute Remote (65639)
11/29/2016 1:23:49 PM Info Task started(Remote Execute): Execute Remote (65639)
11/29/2016 1:23:49 PM Debug Impersonation result 1: <ImpersonationResultClass xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<LoggedOn>true</LoggedOn>
<ProfileLoaded>false</ProfileLoaded>
<UsingLocalLogon>false</UsingLocalLogon>
<ImpersonatedAs>NT AUTHORITY\SYSTEM</ImpersonatedAs>
<ErrorOccured>false</ErrorOccured>
<ErrorString />
<Token>4644</Token>
</ImpersonationResultClass>
11/29/2016 1:23:49 PM Info Impersonation result 2: True, suppress flow: True
11/29/2016 1:23:52 PM Err Task "Execute Remote" exited with code: 77777(VisualCron specific error)
11/29/2016 1:23:52 PM Debug Task->Execute Remote->ImpersonateUndo->Result: <UndoImpersonationResultClass xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<IsProfileLoaded>false</IsProfileLoaded>
<ProfileHandle>0</ProfileHandle>
<TokenHandle>4644</TokenHandle>
<DuplicateTokenHandle>0</DuplicateTokenHandle>
<DuplicateTokenUsed>false</DuplicateTokenUsed>
<UnloadUserProfileResult>false</UnloadUserProfileResult>
<ImpersonationContextUndoResult>true</ImpersonationContextUndoResult>
<CloseTokenHandleResult>false</CloseTokenHandleResult>
<CloseDuplicateTokenHandleResult>false</CloseDuplicateTokenHandleResult>
<CloseProfileHandleResult>false</CloseProfileHandleResult>
<Errors />
</UndoImpersonationResultClass> - current user: NT AUTHORITY\SYSTEM
11/29/2016 1:23:52 PM Info Task completed (Failure)->'Execute Remote' (65639)
11/29/2016 1:23:52 PM Debug PrevTaskProcess(Execute Remote)->ExitCodeResult: Failure (ECCId: 746c95ce-d394-491c-925c-8bd50e4daa8ePId: 65639, Exit code: 77777)
11/29/2016 1:23:52 PM Debug Found 1 matching flows. (65639)
11/29/2016 1:23:52 PM Info Task Notification of type: Email started.
11/29/2016 1:23:52 PM Info Task started(Email): Failure Email to Greg (65640)
11/29/2016 1:23:52 PM Debug Next execution (2) for Job 'SACS Session Report Emulation' is: 5:00:00 AM
11/29/2016 1:23:52 PM Debug SendJobStats->Ended (11/29/2016 1:23:49 PM)
11/29/2016 1:23:52 PM Info Job completed (Failure)->'SACS Session Report Emulation'



*** On “clientBox”, I see this in the Event Viewer:


*** Event Viewer entry #1:

- System
- Provider
[ Name] .NET Runtime

- EventID 1026
[ Qualifiers] 0

Level 2

Task 0

Keywords 0x80000000000000

- TimeCreated
[ SystemTime] 2016-11-29T17:48:07.000000000Z

EventRecordID 434289

Channel Application

Computer clientBox.companyx.com

Security

- EventData
Application: ExcelUtilities.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.Runtime.InteropServices.COMException at Microsoft.Office.Interop.Excel.Workbooks.Open(System.String, System.Object, System.Object, System.Object, System.Object, System.Object, System.Object, System.Object, System.Object, System.Object, System.Object, System.Object, System.Object, System.Object, System.Object) at ExcelUtilities.Program.Main(System.String[])


*** Event Viewer entry #2:
+ System
- Provider
[ Name] Application Error

- EventID 1000
[ Qualifiers] 0

Level 2

Task 100

Keywords 0x80000000000000

- TimeCreated
[ SystemTime] 2016-11-29T17:48:07.000000000Z

EventRecordID 434290

Channel Application

Computer clientBox.companyx.com

Security

- EventData
ExcelUtilities.exe
1.0.0.0
583db9fb
KERNELBASE.dll
6.1.7601.23543
57d2fe27
e0434352
000000000001a06d
2b04
01d24a68bddf61ae
C:\TheDeal\ExcelUtilities\ExcelUtilities.exe
C:\Windows\system32\KERNELBASE.dll
fbd90cc7-b65b-11e6-931f-005056ae793c



*** Here is the C# code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.InteropServices;
using Excel = Microsoft.Office.Interop.Excel;

namespace ExcelUtilities
{
class Program
{
static void Main(string[] args)
{
var excel = new Excel.Application();
var workbook = excel.Workbooks.Open(@"C:\SACSSessionInfo_NEW.xlsx");
workbook.Sheets.Add(Before: workbook.Sheets[workbook.Sheets.Count]);

workbook.Save();
workbook.Close();

Marshal.ReleaseComObject(excel);
}
}
}


Any help would be greatly appreciated. Thanks.

Greg


javascript:insertsmiley('🤬 ','/Images/Emoticons/msp_cursing.gif')
Sponsor
Forum information
Support
2016-11-30T07:32:12Z
I would guess any of the following:

1. it does not have the right permissions (Remote execute have limited ways of impersonating due to restrictions in Windows API - try local execute also)
2. The folder/file does not exist on remote system
3. it is a architecture issue 32/64 bit issue - it may not run as or does not have the dlls for the way it is running
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
GregAvon
2016-11-30T21:05:10Z
Originally Posted by: Support 

I would guess any of the following:

1. it does not have the right permissions (Remote execute have limited ways of impersonating due to restrictions in Windows API - try local execute also)
2. The folder/file does not exist on remote system
3. it is a architecture issue 32/64 bit issue - it may not run as or does not have the dlls for the way it is running



Thanks for the Response.

1. I can run the C# program locally, while logged into the "remote" box with the same credentials I use with VisualCron Remote Execute. It works fine, this way. If it is an impersonation issue, how could I determine this?

2. it exists as I can run everything fine, when I log into the "remote" box.

3. The "remote" box is running 64-bit Windows 7 and the VisualCron server is running Windows Server 2003 R2. Could the dll's be the issue? If it works fine, when running locally, could it be having trouble resolving the dll references, when running same code remotely?

Thanks.

Greg

Scroll to Top