NULL parameter of .Add method in NAV 5.0 Excel Integration

Reedberg
Member Posts: 68
Hello all!
I use Navision 5.0 SP1 and Microsoft Excel 14.0 Object Library to integrate it with Excel. I already looked here in this forum but nothing found!
How to insert a new sheet as the last sheet to the current workbook with the help of Add method?
Here is what is written in the help of Excel:
But I want to ommit the first parameter (before) and use only the second parameter (after);
I tried these code, it doesn't work:
I know several methods to overcome this problem:
- use move method after creating new sheet.
- insert two new sheets before the last sheet, then delete the last sheet, then rename the previous two sheets.
But the question is: what kind of NULL parameter should I use as the first parameter in the Add method? What kind of code should I use in order to insert the new sheet as the last sheet with the help of Add method?
I use Navision 5.0 SP1 and Microsoft Excel 14.0 Object Library to integrate it with Excel. I already looked here in this forum but nothing found!
How to insert a new sheet as the last sheet to the current workbook with the help of Add method?
Here is what is written in the help of Excel:
expression.Add(Before, After, Count, Type) Before Optional Variant An object that specifies the sheet before which the new sheet is added. After Optional Variant An object that specifies the sheet after which the new sheet is added. Count Optional Variant The number of sheets to be added. The default value is one. Type Optional Variant Specifies the sheet type. Remarks If Before and After are both omitted, the new sheet is inserted before the active sheet.If I use these code:
XlSheet := xlApp.Worksheets.Add; XlSheet := xlApp.Worksheets.Add(LastSheet);Then new sheets are inserted before the active sheet or before last sheet, as written in the help.
But I want to ommit the first parameter (before) and use only the second parameter (after);
I tried these code, it doesn't work:
XlSheet := xlApp.Worksheets.Add(,LastSheet); XlSheet := xlApp.Worksheets.Add(param1,LastSheet);where param1 - blank text ('') or integer (1);
I know several methods to overcome this problem:
- use move method after creating new sheet.
- insert two new sheets before the last sheet, then delete the last sheet, then rename the previous two sheets.
But the question is: what kind of NULL parameter should I use as the first parameter in the Add method? What kind of code should I use in order to insert the new sheet as the last sheet with the help of Add method?
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