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 / Word / Programming / October 2005

Tip: Looking for answers? Try searching our database.

Public Function NAME() causes VBA Run-Time error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tony_VBACoder - 19 Oct 2005 16:35 GMT
Can someone tell me why if I name a Public Function "NAME", I get a run-time
error when I try to use the Application.Run VBA code in Word 2000?

Application.Run "NAME"

However, if I use Application.Run "NAME1" instead, and rename my function to
"NAME1", it works?  My assumption is, you cannot name a function "NAME", for
whatever reason.  My simple function is listed below:

Public Function NAME()

MsgBox "Hello"

End Function
Tony_VBACoder - 19 Oct 2005 16:41 GMT
The error I get is:

Run-time error '5863'
Method 'Run' of object '_Application' failed

> Can someone tell me why if I name a Public Function "NAME", I get a run-time
> error when I try to use the Application.Run VBA code in Word 2000?
[quoted text clipped - 10 lines]
>
> End Function
Doug Robbins - Word MVP - 19 Oct 2005 19:00 GMT
I think that it is pretty safe to assume that name is a reserved word.

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> The error I get is:
>
[quoted text clipped - 18 lines]
>>
>> End Function
 
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.