Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Language settings

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default Language settings

Hei Jacob

Post the troublesome code please. Application.Worksheetfunction should not
be a problem.

--
HTH. Best wishes Harald
Excel MVP
Followup to newsgroup only please

"jacob" skrev i melding
...
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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default Language settings

"jacob" skrev i melding
...
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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Language settings

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

"jacob" wrote in message
...
Hi,
Think I found the error. Had moved some code from a
general module to a worksheet module. Appears that I

need
to qualify Range("NamedRange") with Worksheets
("NameOfSheet") where "NamedRange" reside. Is it so

that
code residing within a worksheet module only looks for
named ranges within that sheet unless you specify
otherwise?

The code which did not work in worksheetmodule:

SpecNamePosInList = Application.WorksheetFunction.Match
(sSpecName, Range("SpecName"), 0)

The one that worked:

SpecNamePosInList = Application.WorksheetFunction.Match
(sSpecName, Worksheets("System Defined Tables").Range
("SpecName"), 0)

Thx for your time

-----Original Message-----
Hei Jacob

Post the troublesome code please.

Application.Worksheetfunction should not
be a problem.

--
HTH. Best wishes Harald
Excel MVP
Followup to newsgroup only please

"jacob" skrev i melding
...
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.


.



.

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
Different Language Settings... Trevor Williams Excel Worksheet Functions 5 May 6th 08 03:00 PM
Right to Left sorting without changing language settings Natemoney2 Excel Discussion (Misc queries) 2 July 18th 07 06:24 PM
Eliminating default language settings to all Office 2003 apps. Schermie Excel Discussion (Misc queries) 0 May 6th 06 07:49 PM
excel language settings/cell format boernd Excel Discussion (Misc queries) 1 June 20th 05 12:45 PM
override language settings on date n.almeida Excel Discussion (Misc queries) 0 February 15th 05 02:45 PM


All times are GMT +1. The time now is 08:36 PM.

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"