Public Function NAME() causes VBA Run-Time error

T

Tony_VBACoder

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
 
T

Tony_VBACoder

The error I get is:

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

Doug Robbins - Word MVP

I think that it is pretty safe to assume that name is a reserved word.

--
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top