Excel buffer - export to excel clear sheet

zeon
Member Posts: 130
Hi,
I have an existing Excel file containing five worksheets. I need to export data from Navision to one of those worksheets.
The sheet already contains data, so I need a way to clear the sheet before I make my export. Is there a way to do that, or do I have to run through all columns and rows with data and delete their contents? I'm using Excelbuffer to export the data.
I have tried to just update the sheet with new data, but the problem is that in one situation the export is 500 rows, and the data contains data in 1000 rows, so the last 500 rows is not deleted.
/zeon
I have an existing Excel file containing five worksheets. I need to export data from Navision to one of those worksheets.
The sheet already contains data, so I need a way to clear the sheet before I make my export. Is there a way to do that, or do I have to run through all columns and rows with data and delete their contents? I'm using Excelbuffer to export the data.
I have tried to just update the sheet with new data, but the problem is that in one situation the export is 500 rows, and the data contains data in 1000 rows, so the last 500 rows is not deleted.
/zeon
0
Comments
-
Hello,
Did you solve the problem.
I have exactly the same work to do...
Thanks a lot0 -
I haven't used excelbuffer yet, but there is an automation function which can do that for you.
Its usedrange (part of the excel automation object) which selects all the cells in a predefined range that are not null.0 -
Sog,
THX a lot.
The "usedrange" solved my problem !0 -
Cells.Select Selection.ClearContents
this is the code generated by vb excel when doing
-select all
-press delete
which actually deletes all the contents...try to replicate this in nav with xls automation0
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