Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default VBA-Error Message Assistance Needed

Exclaimation Point in Yellow Yeild Sign Compile error:
Ambiguous name detected: UpdateOffsetPositions.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default VBA-Error Message Assistance Needed

As a guess you have two procedures in the same module with the name
"UpdateOffsetPositions".
--
HTH...

Jim Thomlinson


"MLS7181" wrote:

Exclaimation Point in Yellow Yeild Sign Compile error:
Ambiguous name detected: UpdateOffsetPositions.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 269
Default VBA-Error Message Assistance Needed

This usually means that two instances of the name are in scope. I've
had this when I created a variable as global and then again in a
procedure. Use find to search for duplicate Dim statements of the same
name

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default VBA-Error Message Assistance Needed

Are you sure about that... That kind of a scope issue will resolve itself
according to a heirarchy. For example you can dim a variable myVar as a
Global and also dim myVar within a procedure and it will work just fine.
Within the procedure where myVar is declared the local will supercede the
global.

Agreeably within a procedure you can not declare two varaibles with the same
name, nor can you declare two globals with the same name in the same module.
--
HTH...

Jim Thomlinson


"Zone" wrote:

This usually means that two instances of the name are in scope. I've
had this when I created a variable as global and then again in a
procedure. Use find to search for duplicate Dim statements of the same
name


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 269
Default VBA-Error Message Assistance Needed

Jim, I always use the Option Explicit. If I declare a local variable
with the same name as a global variable (including capitalization), I
get this message. Gosh, am I wrong about this?
James



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default VBA-Error Message Assistance Needed

I've never had any trouble with common local and global names (but I do try to
avoid that).

Any chance you have multiple procedures using that same sub/function name?

How about the module name? I wouldn't use a sub/function name for the module
name, either.

Zone wrote:

Jim, I always use the Option Explicit. If I declare a local variable
with the same name as a global variable (including capitalization), I
get this message. Gosh, am I wrong about this?
James


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 269
Default VBA-Error Message Assistance Needed

Dave is right and I am wrong. A local and global variable with the
same name will not cause the problem. But two procedures with the same
name will cause the problem.

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default VBA-Error Message Assistance Needed

The declaration is valid and the scope expands outwards from the procedure to
the module to the project. That being said it is generaly poor coding
practice to use the same name for a global and a local variable.
--
HTH...

Jim Thomlinson


"Zone" wrote:

Dave is right and I am wrong. A local and global variable with the
same name will not cause the problem. But two procedures with the same
name will cause the problem.


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
Error message needed if incorrect Date Of Birth (DOB) entered Craig Excel Worksheet Functions 5 January 27th 10 09:24 PM
#VALUE! error message help needed please Bob Newman Excel Worksheet Functions 3 November 25th 07 05:56 PM
VBA Assistance Needed RalphB Excel Discussion (Misc queries) 5 February 22nd 06 07:16 PM
.dll error message help needed Wylie C Excel Programming 0 November 1st 05 05:46 PM
Code assistance needed HJ Excel Programming 7 May 27th 05 04:14 PM


All times are GMT +1. The time now is 03:14 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"