View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default text in cell too long? run-time error

Change .Formula to .Value

A formula can only be 1024 characters long. Anyway, it worked fine for me
using .value when the constant string was longer than 1024 characters.

--
Regards,
Tom Ogilvy
"screeb " wrote in message
...
As I'm new here, Hi everyone!

I'm having a problem when I try to copy the content of a text
containing cell to the clipboard.
Everytime the number of characters in the cell exceeds 1024 (1kb) , i
get the following error when running the copy-macro:
run-time error '1004': Application-defined or object-defined error.

The code I use for copying is the following:

Dim MyData As DataObject
Dim MyString As String

Set MyData = New DataObject

MyString = Range("B36").Formula

MyData.SetText MyString
MyData.PutInClipboard


Does anyone know how to overcome that limitation?

thanx in advance


---
Message posted from http://www.ExcelForum.com/