How to import the content of an excel textbox into Navision?

Minu63
Member Posts: 16
Good Morning to everybody!
I have to import the content of an excel textbox (not of a regular cell) into navision. How can I do so?
Thanks a lot
I have to import the content of an excel textbox (not of a regular cell) into navision. How can I do so?
Thanks a lot
0
Comments
-
Is it possible to modify the excel file to have the value of the textbox copied into a hidden sheet in the excel file?
Then you don't have to deal with the problem you layed out.0 -
I'm afraid that this wouldn't work. I have to import thousands of excel sheets (service reports of the past x years). I already tried to write an excel macro to copy the content of the textboxes (there are four on the same sheet) into a regular cell, but I failed writing this macro
But however I think it's also impossible to run the excel macro from Navision, isn't it?0 -
Well If you've failed to write that macro, you migth experience the same problem with import in NAV.
Because the macro exists of the same object as one would implement in NAV. The workbook, worksheet types are also used in NAV. I wish you the best of luck in finding a solution.0 -
Try to save Excel workbook in xml format and then read xml file and parse it.
See also reading large texts from ExcelLooking for part-time work.
Nav, T-SQL.0 -
In the meantime I found a solution on the Microsoft homepage:
Sub CopyAllTextboxContentsToCell()
' .... define first row
x = 1
' .... loop through all textboxes
For Each tbox In ActiveSheet.TextBoxes
' .... select cell and insert text
Range("A" & x).Value = tbox.Text
' .... increase row number
x = x + 1
Next tbox
End Sub
And now the content of the cells A1, A2, etc, is really very easy to import in Navision. Concerning that Navision cannot manage texts larger than 1024 caracters I had to modify the VB Module a little bit:
' .... select cell and insert text
Range("A" & x).Value = Left(tbox.Text, 1024)
Unfortunately the case of a textbox with more than 1024 caracters isn't managed, but in this special case that doesn't matter.
I hope that this solution helps others, too.0 -
Minu63 wrote:
I hope that this solution helps others, too.
:thumbsup: Hi Minu,
thanks for sharing. Its always nice when someone solves their own problem but still comes back to share the solution.
And to rmv_RU, good suggestion thinking outside the box. =D>
Definitely good to see threads like this.David Singleton0
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