Excel Automation - Import file with NAV-code
neckit
Member Posts: 24
I have a Codeunit which exports some tabledata from Navision to Excel with the functions of the ExcelBuffer-Table (Table 370). This works great.
But now i have one table with over 10.000 records and the performance of the export is terrible.
Now im trying to export the records in a csv-File and import them to Excel with a special function in the ExcelBuffer-Table. The export to the csv-File is ok. But i don't know, how I can import the file in Excel with Navision-Code.
Because the Excel-File has several Sheets i can't open the csv-File directly and i also don't want to use a macro in this Excel-File.
Instead of that, I want to import the csv-File to Excel with a new function in the ExcelBuffer-Table.
Excel would use the following Macro-Code.
Is there a way to write this as Function in the ExcelBuffer-Table?
I don't find the right syntax in NAV-Code.
Please help me.
thanks
Ralf
But now i have one table with over 10.000 records and the performance of the export is terrible.
Now im trying to export the records in a csv-File and import them to Excel with a special function in the ExcelBuffer-Table. The export to the csv-File is ok. But i don't know, how I can import the file in Excel with Navision-Code.
Because the Excel-File has several Sheets i can't open the csv-File directly and i also don't want to use a macro in this Excel-File.
Instead of that, I want to import the csv-File to Excel with a new function in the ExcelBuffer-Table.
Excel would use the following Macro-Code.
Is there a way to write this as Function in the ExcelBuffer-Table?
With ActiveSheet.QueryTables.Add(Connection:="TEXT;C:\Test.csv",Destination _
:=Range("$A$1"))
.Name = "Test"
.FieldNames = True
{...}
End With
I don't find the right syntax in NAV-Code.
Please help me.
thanks
Ralf
0
Comments
-
You can look at how NAV does this in the RIM tookit objects.0
-
You can look at how NAV does this in the RIM tookit objects.
I don't have the RIM toolkit - because i'm not a MS-Partner.
It would be great, if you can give me the necessary code out of the RIM toolkit?
Ralf0 -
Hi,
You need to create automation variable which has Worksheet object. Then you need to instatianate it (by calling CREATE(yourWorksheetAutomationVariable) ) you may callyourWorksheetAutomationVariable.ActiveSheet.QueryTables.Add(Here you have to put _every_ single parameter for Add function, required and optionals)
If the parameter is defined as byVar you need to create a new variable in the code, and use variable in function call even if it has constant or NULL value.
Look deeper into Table 370 functions for correct syntax, or here: http://www.mibuso.com/dlinfo.asp?FileID=811
Regards,
SlawekSlawek Guzek - www.yitron.co.uk
Business Central, MS SQL Server, Wherescape RED;0
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
