Language settings

  • Thread starter Thread starter jacob
  • Start date Start date
J

jacob

Hi,
I have an application I'm trying to execute in a
norwegian version of Excel (XP). It fails when coming to
a statement involving a Application.Worksheetfunction
object. I suspect this has to do with language as it
works when using an english version of Excel. Is there
some way around this to make the app independent of
language setting for Excel?

Any help appreciated.
 
Hei Jacob

Post the troublesome code please. Application.Worksheetfunction should not
be a problem.
 
jacob said:
Hi,
Think I found the error. Had moved some code from a
general module to a worksheet module. (...) Is it so that
code residing within a worksheet module only looks for
named ranges within that sheet unless you specify
otherwise?

Probably. Sheet code has limited access to remote objects. Glad you found
the error.

Best wishes Harald
Excel MVP
Followup to newsgroup only please
 
Makes my day. Thx for taking the time.
-----Original Message-----
Assume you are in the sheet1 module and your named range "NamedRange"
refers to Sheet2

in the sheet1 module if you use

vVal = Range("NamedRange")

then this is interpreted to mean

worksheets("Sheet1").Range("NamedRange")

which causes an error.

Any unqualified references are interpreted to refer to the sheet associated
with the sheet module.

Worksheets("Sheet2").Activate
Range("A1").Select

would cause an error since Range("A1").Select would refer to sheet1 which is
not active.

if it had been Range("A1").Value = 3, then A1 on sheet 1 would be changed,
not A1 on sheet2 as probably intended.

--
Regards,
Tom Ogilvy




.
 
Back
Top