Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default Error when string length 1024 and starts with -

Using XL97 SR2. This is more of a puzzle rather than a showstopper, but
I am curious.

In my application, there is a cell that stores a foreman's diary. This
is populated with a userform. Today I had one user getting an Error 7:
Out of Memory when he entered a lot of text. I finally figured out why
and when -- if the length of the string was 1024 *AND* it began with a
hyphen (he uses the hyphen to do bullet points). It was fine if the
length was < 1024 and began with a hyphen, or if it was 1024 and
didn't begin with a hyphen.

As far as I can tell(!), my code isn't bizarre in any way:

Private Sub cmdOK_Click()

Dim strDiary As String

strDiary = Application.WorksheetFunction. _
Substitute(txtDiary.Text, Chr(13), "")
ActiveWorkbook.Worksheets("Diary"). _
Cells(DIARY_ROW, DIARY_COL).Value2 = strDiary
frmDiary.Hide

End Sub

For now, I've told him not to use the hyphen at the beginning of his
diary -- a space or asterisk or anything else -- so we're working around
it. I will eventually modify the code to detect an initial hyphen and
remove it.

Does anyone have any explanation for this? Or is it just a weird
anomaly?

--
Dianne


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Error when string length 1024 and starts with -

A guess but what about Excel seeing the text beginning with a hyphen as a
formula ?

Also is there a limit of 1024 characters in a cell?

Cheers
N


"Dianne" wrote in message
...
Using XL97 SR2. This is more of a puzzle rather than a showstopper, but
I am curious.

In my application, there is a cell that stores a foreman's diary. This
is populated with a userform. Today I had one user getting an Error 7:
Out of Memory when he entered a lot of text. I finally figured out why
and when -- if the length of the string was 1024 *AND* it began with a
hyphen (he uses the hyphen to do bullet points). It was fine if the
length was < 1024 and began with a hyphen, or if it was 1024 and
didn't begin with a hyphen.

As far as I can tell(!), my code isn't bizarre in any way:

Private Sub cmdOK_Click()

Dim strDiary As String

strDiary = Application.WorksheetFunction. _
Substitute(txtDiary.Text, Chr(13), "")
ActiveWorkbook.Worksheets("Diary"). _
Cells(DIARY_ROW, DIARY_COL).Value2 = strDiary
frmDiary.Hide

End Sub

For now, I've told him not to use the hyphen at the beginning of his
diary -- a space or asterisk or anything else -- so we're working around
it. I will eventually modify the code to detect an initial hyphen and
remove it.

Does anyone have any explanation for this? Or is it just a weird
anomaly?

--
Dianne






----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Error when string length 1024 and starts with -

Also is there a limit of 1024 characters in a cell?

No: 32,000

--
Michael Hopwood


"Nigel" wrote in message
...
A guess but what about Excel seeing the text beginning with a hyphen as a
formula ?

Also is there a limit of 1024 characters in a cell?

Cheers
N


"Dianne" wrote in message
...
Using XL97 SR2. This is more of a puzzle rather than a showstopper, but
I am curious.

In my application, there is a cell that stores a foreman's diary. This
is populated with a userform. Today I had one user getting an Error 7:
Out of Memory when he entered a lot of text. I finally figured out why
and when -- if the length of the string was 1024 *AND* it began with a
hyphen (he uses the hyphen to do bullet points). It was fine if the
length was < 1024 and began with a hyphen, or if it was 1024 and
didn't begin with a hyphen.

As far as I can tell(!), my code isn't bizarre in any way:

Private Sub cmdOK_Click()

Dim strDiary As String

strDiary = Application.WorksheetFunction. _
Substitute(txtDiary.Text, Chr(13), "")
ActiveWorkbook.Worksheets("Diary"). _
Cells(DIARY_ROW, DIARY_COL).Value2 = strDiary
frmDiary.Hide

End Sub

For now, I've told him not to use the hyphen at the beginning of his
diary -- a space or asterisk or anything else -- so we're working around
it. I will eventually modify the code to detect an initial hyphen and
remove it.

Does anyone have any explanation for this? Or is it just a weird
anomaly?

--
Dianne






----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet

News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000

Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption

=---


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Error when string length 1024 and starts with -


Thanks, but the limit is only 1024 can display in a cell - I think?.

"Michael Hopwood" wrote in message
...
Also is there a limit of 1024 characters in a cell?


No: 32,000

--
Michael Hopwood


"Nigel" wrote in message
...
A guess but what about Excel seeing the text beginning with a hyphen as

a
formula ?

Also is there a limit of 1024 characters in a cell?

Cheers
N


"Dianne" wrote in message
...
Using XL97 SR2. This is more of a puzzle rather than a showstopper,

but
I am curious.

In my application, there is a cell that stores a foreman's diary. This
is populated with a userform. Today I had one user getting an Error 7:
Out of Memory when he entered a lot of text. I finally figured out why
and when -- if the length of the string was 1024 *AND* it began with

a
hyphen (he uses the hyphen to do bullet points). It was fine if the
length was < 1024 and began with a hyphen, or if it was 1024 and
didn't begin with a hyphen.

As far as I can tell(!), my code isn't bizarre in any way:

Private Sub cmdOK_Click()

Dim strDiary As String

strDiary = Application.WorksheetFunction. _
Substitute(txtDiary.Text, Chr(13), "")
ActiveWorkbook.Worksheets("Diary"). _
Cells(DIARY_ROW, DIARY_COL).Value2 = strDiary
frmDiary.Hide

End Sub

For now, I've told him not to use the hyphen at the beginning of his
diary -- a space or asterisk or anything else -- so we're working

around
it. I will eventually modify the code to detect an initial hyphen and
remove it.

Does anyone have any explanation for this? Or is it just a weird
anomaly?

--
Dianne






----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet

News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000

Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via

Encryption
=---






----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
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
Zero length string on chart Joe M. Charts and Charting in Excel 1 May 6th 10 03:16 PM
Error message is Character Limit is over 1024 characters Vick Excel Discussion (Misc queries) 2 January 30th 09 06:19 PM
Finding a string of unknown length in a string of unknown length, Help! Hankjam[_2_] Excel Discussion (Misc queries) 8 July 3rd 08 06:49 PM
String length jxbeeman Excel Discussion (Misc queries) 1 January 10th 08 07:01 PM
How to find if a string starts with a digit galsaba Excel Worksheet Functions 1 March 4th 05 06:01 PM


All times are GMT +1. The time now is 05:44 AM.

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"