Excel Automation and TexttoColumn
Carle_001
Member Posts: 4
Hi all,
Has anyone in the past used the Excel Automation TextToColumn within 'Microsoft Excel 11.0 Object Library'.Range?
I am trying to take a text field which could be more than 1024 Characters and use the TextToColumn Function with Parameters to set it to Fixed Length of 250 Characters and split the field out to a number of fields.
This would allow me to then set-up an array when reading the Excel sheet back into Navision which would read the 250 character text fields and place them into a text/comments table.
The problems I seem to be getting are on formating the TextToColumn statement so any help would be greatly appreciated.
Regards
Carl Edwards
Has anyone in the past used the Excel Automation TextToColumn within 'Microsoft Excel 11.0 Object Library'.Range?
I am trying to take a text field which could be more than 1024 Characters and use the TextToColumn Function with Parameters to set it to Fixed Length of 250 Characters and split the field out to a number of fields.
This would allow me to then set-up an array when reading the Excel sheet back into Navision which would read the 250 character text fields and place them into a text/comments table.
The problems I seem to be getting are on formating the TextToColumn statement so any help would be greatly appreciated.
Regards
Carl Edwards
0
Comments
-
The error I seem to be getting is TextToColumns Method of Range Class failed.
From what I have read this is down to the Parameters being passed.
](*,)0 -
Okay I found a solution and maybe others might be interested in this so I decided to post it.

I passed the VB Constant number so for example
xlTextQualifierNone = -4142 on the TextToColumn Function.
I tried this method with PasteSpecial so passed the command
XlRange.PasteSpecial(-4163,-4142);
This did a Paste Special Values Only with a Paste Special Operations of None.
Hope this helps someone as it's only taken me 5 days to track down the problem.
Carl0 -
I am no programmer and no expert in Print2Excel yet (just obtained it) but wouldn't it be easier to just use this print driver that "prints" to Excel?0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K 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
- 323 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