Public variable looses value

T

Thomas Wiedmann

Hello,

I declared the following variable for use in some procedures concerning
table cells:
Public cellLimit As String

In the AutoOpen procedure cellLimit is initialized:
cellLimit = vbCr + Chr(7)

Nevertheless in some cases - not reproducible so far - obviously cellLimit
looses its value and becomes "",
but is no other statement in my modules where the value of cellLimit ist
changed.

What may be the reason for this strange behaviour?
How could the problem be resolved?

I would like to have 'cellLimit = vbCr + Chr(7)' as constant, but
unfortunately this isn't possible in VBA.
Is there perhapse another way to get 'vbCr + Chr(7)' as public constant?

Thomas Wiedmann
 
H

Harold Druss

Thomas Wiedmann said:
Hello,

I declared the following variable for use in some procedures concerning
table cells:
Public cellLimit As String

In the AutoOpen procedure cellLimit is initialized:
cellLimit = vbCr + Chr(7)

Nevertheless in some cases - not reproducible so far - obviously cellLimit
looses its value and becomes "",
but is no other statement in my modules where the value of cellLimit ist
changed.

What may be the reason for this strange behaviour?
How could the problem be resolved?

I would like to have 'cellLimit = vbCr + Chr(7)' as constant, but
unfortunately this isn't possible in VBA.
Is there perhapse another way to get 'vbCr + Chr(7)' as public constant?

Thomas Wiedmann
Hi Thomas
Try using "vbCr & Chr(7)"
Harold
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top