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 / July 2006

Tip: Looking for answers? Try searching our database.

Gettin File name in macro

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
redf1re - 05 Jul 2006 18:12 GMT
Hi... is it possible by macro to know its file name??? something like
variable receaving "teste.xls" as valu
Nick Hodge - 05 Jul 2006 18:24 GMT
Something like

Sub GetWorkbookName()
Dim wbName As String
wbName = ActiveWorkbook.Name
MsgBox wbName & ".xls"
End Sub

Signature

HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
www.nickhodge.co.uk
nick_hodgeTAKETHISOUT@zen.co.uk.ANDTHIS

> Hi... is it possible by macro to know its file name??? something like a
> variable receaving "teste.xls" as value
Dave Peterson - 05 Jul 2006 19:11 GMT
You can get it via:

activeworkbook.name
activeworkbook.fullname
and maybe you'd want
activeworkbook.path

.fullname will include the path.  .Path will just give the path.

But both .name and .fullname will include any extension (if the file was saved
with an extension).

> Hi... is it possible by macro to know its file name??? something like a
> variable receaving "teste.xls" as value
[quoted text clipped - 4 lines]
> redf1re's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=31258
> View this thread: http://www.excelforum.com/showthread.php?threadid=558539

Signature

Dave Peterson

redf1re - 05 Jul 2006 20:52 GMT
thanx all                                                            
:)

Signature

redf1re


Rate this thread:






 
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.