View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Nigel[_2_] Nigel[_2_] is offline
external usenet poster
 
Posts: 735
Default String vs LONG format

Looks like Andrew Taylor has put his finger on it. Its a WORD problem

--

Regards,
Nigel




"Ruth" wrote in message
...
It seems to be a problem in EXCEL, and most likely the problem is that I
haven't defined something properly but I don't know exactly what.

"Nigel" wrote:

I am no expert on WORD, this appears to be an issue in that application
not
Excel. If the text is already stored in an Excel cell then you have not
exceeded any limits, and string var will handle that length of string.
So
it must be a limit in Word.

Have you tried the word programming newsgroup ?

Sorry I do not have a specific solution

--

Regards,
Nigel




"Ruth" wrote in message
...
Thanks for your answer. In case I didn't explain it clear before I will
try
to reformulate the problem...

- Cells T1...500 in EXCEL contains a paragraph of text of whatever
lenght
(it is not known beforehand!) that has to be copied in a form in word.

- The field Text3 is the field in the WORD form where I want to copy
the
text from the previous cell (there is one field for each cell).

Depending on the length of the content of the text in the cells
T1...500,
the follwowing routine works or not ...

If wdFF.Name = "Text3" Then
wdFF.Result = Range("T" & fila)
End If

If the text in the EXCEL cell is long enough, the previous routine
fails
in
execution because wdFF.Result is expecting to see a String and seems
the
text
in the cell is too long for a string.
Any idea of how to avoid this problem?


"Nigel" wrote:

The result of the evaluation of Range("T" & fila) presumably returns a
string? What do you mean when you say "the info received is much
longer",
a string is a string! Long vars refer to a numerical value not a
string.

You could convert the value to a string using Cstr(Range("T" & fila))
but
you probably need some error checking to avoid error values, nulls
etc.



--

Regards,
Nigel




"Ruth" wrote in message
...
Hey guys,

Any idea about how to solve this?

I want to copy some cells in EXCEL to a form in WORD. The problem is
when
the cells in EXCEL contain some long paragraphs of text. I have done
it
in
the following
way:

If wdFF.Name = "Text3" Then
wdFF.Result = Range("T" & fila)
End If

Text3 is the field in the form where the info should be inserted. If
I
copy
and paste manually the info to the field in the form it works fine
but
with
the code above it does not work because it seems the object wdFF is
expecting
to see only a string and the info received is much longer. Is there
any
way
to modify the format of the object wdFF from string to long?? or
should
I
cut
and put together later on?

Thanks!!