I have error when import data from excel 'The length of the text string exceeds the size of the string buffer'.
Can you help me with this problem? How I can increase string buffer?
save the excel file as tab delimited, does it still have just one letter? Find the item record it is importing, There should be hidden characters or something.
Ahmed Rashed Amini
Independent Consultant/Developer
I am sure that this colomn have only 1 character, and I have only one line, its a test file and all data I write manualy. All other fields contain not more then 12 characters. I have no idea why I have this error. Maybe all line writing in this buffer, but I now that all line will contain maximum 120 characters, or maybe colomn with date type or with numeric type occupies a lot of place in this buffer.
The shape of Dynamics Nav to import data from excel is through a table called Excel Buffer and the book Microsoft Excel 12.0 Object Library.
Is loaded in each table entry value of each cell in the Excel spreadsheet and a series of properties (font, formula, etc. ..). The problem I have raised is that the library has a 1000 character string buffer, if a leaf cell has more than 1000 characters to use the Value method to get the contents of the cell and record it in the Excel Buffer table fails buffer overflow in the library. Obviously the size of the buffer can not be changed in the dll.
To fix it I have done the following:
locTextLargo1: = FORMAT (XlWrkSht.Range ("IV3 '). Value);
locTextLargo2: = FORMAT (XlWrkSht.Range ("IV4"). Value);
locTextLargo3: = FORMAT (XlWrkSht.Range ("IV5"). Value);
What I do is use the formula in Excel to record blocks REMOVE thousand thousand characters of the cell that I'm importing (xlColID xlRowID) in other cells, in this case I use IV3 IV4 IV5 cells that being the last columns I assume they will be empty. Then we can obtain the values of the three separate cells.
Comments
You option is to save it as xml and use xmlport and bigtext to load the file. :roll:
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Here is piece of my code.
In excel I don't have information with length more than 1024.
May be I don't understabd somthing? :-k
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Another column?
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
http://blogdynamics.blogspot.com/2010/1 ... es-de.html
The shape of Dynamics Nav to import data from excel is through a table called Excel Buffer and the book Microsoft Excel 12.0 Object Library.
Is loaded in each table entry value of each cell in the Excel spreadsheet and a series of properties (font, formula, etc. ..). The problem I have raised is that the library has a 1000 character string buffer, if a leaf cell has more than 1000 characters to use the Value method to get the contents of the cell and record it in the Excel Buffer table fails buffer overflow in the library. Obviously the size of the buffer can not be changed in the dll.
To fix it I have done the following:
XlWrkSht.Range ("IV3 '). Formula: =" = MID (' xlColID xlRowID ', 1, 1000)';
XlWrkSht.Range ("IV4"). Formula: = "= MID ('xlColID xlRowID'; 1001; 1000) ';
XlWrkSht.Range ("IV5"). Formula: = "= MID ('xlColID xlRowID', 2001, 1000) ';
locTextLargo1: = FORMAT (XlWrkSht.Range ("IV3 '). Value);
locTextLargo2: = FORMAT (XlWrkSht.Range ("IV4"). Value);
locTextLargo3: = FORMAT (XlWrkSht.Range ("IV5"). Value);
What I do is use the formula in Excel to record blocks REMOVE thousand thousand characters of the cell that I'm importing (xlColID xlRowID) in other cells, in this case I use IV3 IV4 IV5 cells that being the last columns I assume they will be empty. Then we can obtain the values of the three separate cells.
http://www.interdynbmi.com