Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / May 2008

Tip: Looking for answers? Try searching our database.

Excel 2003 - VBA - Ambigous Name Detected

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Craig Brandt - 21 May 2008 16:08 GMT
With code in Module 6, I created a button on a sheet as follows:
   ActiveSheet.Buttons.Add(1245, 16, 80, 16).Select
   Selection.Caption = "AutoFocus On"
   Selection.Name = "AutoFocusBut"
   Selection.OnAction = "FocusOn"
   Focus = True

I placed the sub "FocusOn" also in Module 6.
Public Sub FocusOn()
   If Focus = True Then
...
...

When the button is depressed I get the message: "Ambigous name detected:
FocusOn".

What am I missing.

Craig
Jim Rech - 21 May 2008 16:29 GMT
My bet is you have two 'things' named FocusOn.  Two subs or a sub and a
variable.  Something like that.

Signature

Jim

| With code in Module 6, I created a button on a sheet as follows:
|    ActiveSheet.Buttons.Add(1245, 16, 80, 16).Select
[quoted text clipped - 15 lines]
|
| Craig
Craig Brandt - 21 May 2008 16:55 GMT
Jim:
You hit the nail on the head!  I had two procedures named FocusOn.
Thanks,
Craig

> My bet is you have two 'things' named FocusOn.  Two subs or a sub and a
> variable.  Something like that.
[quoted text clipped - 18 lines]
> |
> | Craig
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.