"Name" Keyword ?

A

Alan

I cannot find information on what the VBA keyword "Name" means, as
in:

Name FileName As FileName

Can someone help me out? The complete code is shown below.

Thanks, Alan

Private Function CheckFileCreated(FileName As String) As Boolean
On Error GoTo ErrorHandler
CheckFileCreated = False
Name FileName As FileName
CheckFileCreated = True
ErrorHandler:
End Function
 
D

Dave Peterson

Search VBA's help for "rename"

Then click on the link to "name statement"

(or just search for "name statement" directly)
 
C

Chip Pearson

The Name statement renames an existing file. The basic syntax is

Name Original_File_Name As New_File_Name

For example, the following code renames "C:\Book1.xls" to
"C:\BookOne.xls":

Name "C:\Book1.xls" As "C:\BookOne.xls"

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)
 
R

Rick Rothstein

Type Name in the Immediate window, press F1 and select the item for the VBA Library (it is 1st item in my list).
 

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