SBX - Search With Button

SBX - Forum Post Title

Automation in NAV 2016

Microsoft Dynamics NAV Forum

SUBRATA BAURI asked a question on 5 Jul 2018 2:20 AM
My Badges

Question Status

Suggested Answer

Dear Sir,

I have faced the below mentioned issue in NAV 2016 Database.

-----------------Error------------------------ 
Microsoft Dynamics NAV
--------------------------- 
Unable to create an instance of Automation Server
ScriptControl Object with CLSID = 0e59f1d5-1fbe-11d0-8ff2-00a0d10038bc
Retrieving the COM class factory for component with CLSID {0E59F1D5-1FBE-11D0-8FF2-00A0D10038BC}
failed due to the following error: 80040154 Class not registered
(Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))..
---------------------------
OK
---------------------------
But the same thing is working fine NAV 2013 Environment.
What is the reason behind it ?
Note : 
The Automation Variable is  'Microsoft Script Control 1.0'.ScriptControl
Reply
Andrey Baludin responded on 5 Jul 2018 2:24 AM
My Badges
Suggested Answer

Hi! You need to replace automation to dotnet variables. It's not very complicated.

Reply
SUBRATA BAURI responded on 5 Jul 2018 2:37 AM
My Badges

Thanks for your instant reply.

I know that the automation to dotnet is my last option. But how the same is working fine in NAV 2013 ?

Reply
RockWith NAV responded on 5 Jul 2018 7:49 AM
My Badges
Suggested Answer

Some of the Architectural change, As a generic process I will always recommend to use DotNet Variables instead of Automation.

Reply
Suggested Answer

Hi,

NAV 2013 had less control over Denial Of Service issues by design, from NAV 2015 the security policies have changed (restricted by Design),

use DotNet Variables.

Reply
SUBRATA BAURI responded on 9 Jul 2018 3:46 AM
My Badges

Is there any default DotNet Variable exists for Microsoft Script Control 1.0 ?

Reply
Andrey Baludin responded on 10 Jul 2018 9:45 AM
My Badges
Suggested Answer

Check this one:

https://msdn.microsoft.com/en-us/library/system.web.ui.scriptcontrol(v=vs.110).aspx

Reply
SUBRATA BAURI responded on 11 Jul 2018 8:24 AM
My Badges

This is pseudo code which I need to execute thru the dotnet variable. This VB script is used to insert a entire row into an excel sheet. 

Where do I get the same functionality in dotnet variable ?

ScriptCtrl.Language('VBScript');
........................

REPEAT
ScriptCtrl.Reset;
ScriptCtrl.AddObject('xl',Excel);
..........................

ScriptCtrl.AddCode('SUB Insert()' + ............... CrLf + 'END SUB');

ScriptCtrl.ExecuteStatement('Insert');

UNTIL rec.Next =0;

Reply
Andrey Baludin responded on 11 Jul 2018 9:55 AM
My Badges
Suggested Answer

Look at table 370 Excel buffer. Here we have functions for creation and managing excel books. It's much simple than doing the same with VB scripts.

Also in RU localization there is codeunit 12416 Excel Management.

Reply
SUBRATA BAURI responded on 12 Jul 2018 4:57 AM
My Badges

Thanks for your advice!

The Excel Buffer and Excel Automation are not performing well while exporting bulk record. But the VBScript code is performing very fast.

The Script exports  an EntireRow while exporting into excel.

Reply
Andrey Baludin responded on 5 Jul 2018 2:24 AM
My Badges
Suggested Answer

Hi! You need to replace automation to dotnet variables. It's not very complicated.

Reply
RockWith NAV responded on 5 Jul 2018 7:49 AM
My Badges
Suggested Answer

Some of the Architectural change, As a generic process I will always recommend to use DotNet Variables instead of Automation.

Reply
Suggested Answer

Hi,

NAV 2013 had less control over Denial Of Service issues by design, from NAV 2015 the security policies have changed (restricted by Design),

use DotNet Variables.

Reply
Andrey Baludin responded on 10 Jul 2018 9:45 AM
My Badges
Suggested Answer

Check this one:

https://msdn.microsoft.com/en-us/library/system.web.ui.scriptcontrol(v=vs.110).aspx

Reply
Andrey Baludin responded on 11 Jul 2018 9:55 AM
My Badges
Suggested Answer

Look at table 370 Excel buffer. Here we have functions for creation and managing excel books. It's much simple than doing the same with VB scripts.

Also in RU localization there is codeunit 12416 Excel Management.

Reply

SBX - Two Col Forum

SBX - Migrated JS