Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default busted workaround for 255 character limit in cells

Hello,

I recently encountered an annoying 'bug' in excel. While I can enter 32K
characters in a single cell, if I use oledb to write to and Excel
spreadsheet, the limit on character size is 255. This problem has been
reported in many different places.

Regardless, I still needed to write more than 255 characters
programmatically. I decided to use XML. Some preliminary testing
demonstrated that writing the constructed cell contents to an XML file, then
importing it to excel successfully brought in all the data.

Yahoo.

But then the typical 'gotcha' reared its most unattractive head.

Importing the XML file into Excel had the side-effect of sorting the XML
elements by Element name ?!?!!?

This is not acceptable.

How can I import an XML file into Excel XP and NOT have the columns sorted
on element name?

Mklapp

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 86
Default busted workaround for 255 character limit in cells

If you rename the .xml file to .txt and import it as a text file, you can
easily get more than 256 characters into each cell.
--
Gary's Student


"mklapp" wrote:

Hello,

I recently encountered an annoying 'bug' in excel. While I can enter 32K
characters in a single cell, if I use oledb to write to and Excel
spreadsheet, the limit on character size is 255. This problem has been
reported in many different places.

Regardless, I still needed to write more than 255 characters
programmatically. I decided to use XML. Some preliminary testing
demonstrated that writing the constructed cell contents to an XML file, then
importing it to excel successfully brought in all the data.

Yahoo.

But then the typical 'gotcha' reared its most unattractive head.

Importing the XML file into Excel had the side-effect of sorting the XML
elements by Element name ?!?!!?

This is not acceptable.

How can I import an XML file into Excel XP and NOT have the columns sorted
on element name?

Mklapp

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default busted workaround for 255 character limit in cells

Thanks. I actually got it into the sheet by manually importing the XML file,
then deleting the schema data. A bit kludgy but it still works.



"Gary's Student" wrote:

If you rename the .xml file to .txt and import it as a text file, you can
easily get more than 256 characters into each cell.
--
Gary's Student


"mklapp" wrote:

Hello,

I recently encountered an annoying 'bug' in excel. While I can enter 32K
characters in a single cell, if I use oledb to write to and Excel
spreadsheet, the limit on character size is 255. This problem has been
reported in many different places.

Regardless, I still needed to write more than 255 characters
programmatically. I decided to use XML. Some preliminary testing
demonstrated that writing the constructed cell contents to an XML file, then
importing it to excel successfully brought in all the data.

Yahoo.

But then the typical 'gotcha' reared its most unattractive head.

Importing the XML file into Excel had the side-effect of sorting the XML
elements by Element name ?!?!!?

This is not acceptable.

How can I import an XML file into Excel XP and NOT have the columns sorted
on element name?

Mklapp

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 593
Default busted workaround for 255 character limit in cells



mklapp wrote:

While I can enter 32K
characters in a single cell, if I use oledb to write to and Excel
spreadsheet, the limit on character size is 255.


Sub OleDbWrite32K()
Dim con As Object
Set con = CreateObject("ADODB.Connection")
With con
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = _
"Data Source=C:\Delme.xls;" & _
"Extended Properties='Excel 8.0'"
.Open
.Execute "CREATE TABLE Test (memo_col MEMO);"

Dim testValue As String
testValue = String$(32000, "a")

.Execute "INSERT INTO Test VALUES ('" & testValue & "');"

Dim rs As Object
Set rs = con.Execute( _
"SELECT LEN(memo_col) AS text_length FROM Test;")
End With

MsgBox rs(0).Name & vbTab & rs(0).Value
End Sub

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Workaround for HYPERLINK argument length limit Dave Booker Excel Worksheet Functions 5 April 4th 23 02:22 PM
Excel text export limit - 1024 per line (not cell), workaround? Dave Excel Discussion (Misc queries) 11 August 11th 09 04:41 PM
Need to set character limit in cells of a worksheet. Justine Excel Worksheet Functions 3 July 16th 09 04:39 AM
workaround for problem hyperlinks in Excel (doesn't work if pathcontains # character) [email protected] Excel Worksheet Functions 0 December 21st 07 10:04 PM
Is there a 255 character limit in pivot table cells? RH-at-PDCO Excel Worksheet Functions 1 June 18th 07 09:35 PM


All times are GMT +1. The time now is 12:37 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"