XlRange Automation replacement in 2016
rathin_mca
Member Posts: 14
Hi Experts,
Need a help
2009 XlRange automation used with below code
//"Cell Value as Text" := DELCHR(FORMAT(XlWrkSht.Range(xlColID + xlRowID).Value),'<',' ');
XlRange := XlWrkSht.Range(xlColID + xlRowID);
"Cell Value as Text" := DELCHR(FORMAT(XlRange.Value),'<',' ');
Formula := '';
IF (FORMAT(XlRange.HasFormula)) = FORMAT(TRUE) THEN
Formula := FORMAT(XlRange.Formula);
Bold := FORMAT(XlRange.Font.Bold) = FORMAT(TRUE);
IF (FORMAT(XlRange.Font.Italic) = FORMAT(TRUE)) THEN
Italic := TRUE;
Underline := FORMAT(XlRange.Font.Underline) = FORMAT(TRUE);
//NumberFormat := FORMAT(XlRange.NumberFormat);
xlPosID := xlColID+xlRowID;
I have replaced using dot net but am getting error
Created DotNet var for XLRange and used this variable where ever exist
Microsoft.Office.Interop.Excel.Range.'Microsoft.Office.Interop.Excel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'
but am getting the err when i import the excel
A DotNet variable has not been instantiated. Attempting to call Microsoft.Office.Interop.Excel.Worksheet.Range in Table Excel Buffer: ReadSheet
Need a help
2009 XlRange automation used with below code
//"Cell Value as Text" := DELCHR(FORMAT(XlWrkSht.Range(xlColID + xlRowID).Value),'<',' ');
XlRange := XlWrkSht.Range(xlColID + xlRowID);
"Cell Value as Text" := DELCHR(FORMAT(XlRange.Value),'<',' ');
Formula := '';
IF (FORMAT(XlRange.HasFormula)) = FORMAT(TRUE) THEN
Formula := FORMAT(XlRange.Formula);
Bold := FORMAT(XlRange.Font.Bold) = FORMAT(TRUE);
IF (FORMAT(XlRange.Font.Italic) = FORMAT(TRUE)) THEN
Italic := TRUE;
Underline := FORMAT(XlRange.Font.Underline) = FORMAT(TRUE);
//NumberFormat := FORMAT(XlRange.NumberFormat);
xlPosID := xlColID+xlRowID;
I have replaced using dot net but am getting error
Created DotNet var for XLRange and used this variable where ever exist
Microsoft.Office.Interop.Excel.Range.'Microsoft.Office.Interop.Excel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'
but am getting the err when i import the excel
A DotNet variable has not been instantiated. Attempting to call Microsoft.Office.Interop.Excel.Worksheet.Range in Table Excel Buffer: ReadSheet
0
Answers
-
I could be [XlWrkSht.Range(xlColID + xlRowID);] is not returning a (valid) range so the XlRange is not created.\\The truth exists in seven versions.0
-
Hi Rathin,
if You are using Same Code Implementation in Dotnet Can I know the Nav Version you Are using right Now ..
there are Many Differences in Code Syntax To Dotnet When Compared to Automation Variables. Like
XlRange := XlWrkSht.Range(xlColID + xlRowID);
Xlrange := Xlwrksht.Range('A'+i,'B'+i);
Let Me Know If Above Is Not the problem ...0 -
Hi Venkat,
I am trying to implement to 20160 -
Hi Rathin,
I Have Implemented it In 2016 For our Cliet As Dotnet Will Be Fast Compared to Automation Variables .
What Should i Post To Help Your Cause. i Have Done Many Reports using Those Variables0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 610 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
