NAV 4.0, Localized Excel and property Formula

Martina_Jindrů
Member Posts: 3
Because in NAV is a small bug which don't allow write to property Formula of Cell US expression then it's big problem write transparent international application with localized Excel.
I found a small trick how to get subfolders for any folder though NAV don't know FOR EACH - Windows Script Host Object Model Folders and Files.
There is result:
variables:
Name DataType Subtype Length
loScript Automation 'Microsoft Script Control 1.0'.ScriptControl
lcCode Text 1024
loData Automation 'Microsoft Scripting Runtime'.Dictionary
lcPom Text 1024
lii Integer
MartinaJ
I found a small trick how to get subfolders for any folder though NAV don't know FOR EACH - Windows Script Host Object Model Folders and Files.
There is result:
variables:
Name DataType Subtype Length
loScript Automation 'Microsoft Script Control 1.0'.ScriptControl
lcCode Text 1024
loData Automation 'Microsoft Scripting Runtime'.Dictionary
lcPom Text 1024
lii Integer
CREATE(loData); CREATE(loScript); lcCode :='loCell.Formula=loList.Item(1);'; lii:=1; // for each cell XlCell:=XlWrkSht.Range(xlColID + xlRowID); loScript.Language := 'JScript'; // Add objects loScript.AddObject('loCell', XlCell); // excel cell loScript.AddObject('loList', loData); // dictionary object lcPom:=GetFormula(); // Formula definition loData.Add(lii,lcPom); // Add formula to dictionary object loScript.ExecuteStatement(lcCode); // Execute javascript loData.RemoveAll(); // remove item from dictionary loScript.Reset(); // reset Script object for next using
MartinaJ
0
Comments
-
Nice meeting you.
I have tried with the example you provided. But I did't able to compile the code because of 'GetFormula()' Function it is not defined from where this function has to be called.
Please, Provide the Solution for this.
Regards,
kiran.Hi0 -
I'm sorry. GetFormula is trigger from table 370 (Excel Buffer)
CREATE(loData); CREATE(loScript); lcCode :='loCell.Formula=loList.Item(1);'; lii:=1; // for each cell XlCell:=XlWrkSht.Range('C5'); loScript.Language := 'JScript'; // Add objects loScript.AddObject('loCell', XlCell); // excel cell loScript.AddObject('loList', loData); // dictionary object loData.Add(lii,'=SUM(C1:C4)'); // Add formula to dictionary object loScript.ExecuteStatement(lcCode); // Execute javascript loData.RemoveAll(); // remove item from dictionary loScript.Reset(); // reset Script object for next using
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions