Linefeed character creates runtime error in Sweden

K

Kate

Has anyone heard of this:

I have designed a spreadsheet so that each cell's data
validation text and title appear in a text box at the top of
the screen as the cell is entered. I have used chr(10) in
the VBA code to insert a line feed between the title and the
text in the text box. This of course works fine in this
country (USA), but I had a report from a user in Sweden that
he was getting a run-time error at this line, 'can't find
project or library.' He has all the same references checked
as did I.

When I removed the chr(10) code and put the title and text
on the same line, it worked fine!

Is there some other linefeed character that anyone knows
about which works in ALL languages??

Thanks for your help all,
Kate
 
T

Tim Williams

On the problem PC, which reference shows as "missing" in the VBE ?
As far as I know there should be no location-specific problem using chr(10):
your error is most likely a side-effect of some other issue.

Tim
 
K

Kate

Tim, thanks for the reply. I did ask him to check that he
had all the references which I had checked, and he said he
wasn't missing any of them. And as I said, when I removed
the chr(10) code, he had no error.

-Kate
 
P

Peter T

Hi Kate,

My guess is you built your project in a later version of Excel that of your
user in Sweden.
Try changing -
chr(10)
to
VBA.Strings.Chr(10)

If that fixes the current problem it would indicate a version difference and
a possibility of other problems yet to be discovered.

Because of the "can't find project or library" without missing ref, you
mentioned, I'll lay odds on the above. Solution, build in the earliest
version, or ask user to recreate a new workbook and drag modules from old
into the new.

Otherwise - chr(10), hmm, not sure if that works correctly in a Mac, but if
user indeed has a Mac try vbNewLine instead.

Regards,
Peter T
 
K

Kate

Peter, thank you for those suggestions. I will pursue them
as possible solutions. -Kate
 

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